Add files via upload
This commit is contained in:
parent
0329c04e26
commit
6b3ecf152b
4 changed files with 80 additions and 10 deletions
|
@ -438,8 +438,34 @@ local function setDebugStat(key: string, value: any)
|
||||||
debugStats:SetAttribute(key, value)
|
debugStats:SetAttribute(key, value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--THIS IS WHERE THE SPAWNLOCATION IMPLEMENTATION IS
|
||||||
|
local function getTeamSpawnPosition(player)
|
||||||
|
local teamColor = player.TeamColor
|
||||||
|
local spawnLocations = game.Workspace:GetDescendants()
|
||||||
|
local teamSpawn = nil
|
||||||
|
|
||||||
|
-- Find a spawn location with the same TeamColor as the player's team
|
||||||
|
for _, spawn in pairs(spawnLocations) do
|
||||||
|
if spawn.ClassName == "SpawnLocation" then
|
||||||
|
if spawn.TeamColor == teamColor then
|
||||||
|
teamSpawn = spawn
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if teamSpawn then
|
||||||
|
return teamSpawn.Position
|
||||||
|
else
|
||||||
|
warn("No spawn location found for team color: " .. tostring(teamColor))
|
||||||
|
return game.workspace:FindFirstChild("SpawnLocation") --default
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function onReset()
|
local function onReset()
|
||||||
local roblox = Vector3.yAxis * 100
|
local roblox = getTeamSpawnPosition(player) --THIS IS WHERE THE SPAWNLOCATION IMPLEMENTATION IS CALLED
|
||||||
local sm64 = Util.ToSM64(roblox)
|
local sm64 = Util.ToSM64(roblox)
|
||||||
local char = player.Character
|
local char = player.Character
|
||||||
|
|
||||||
|
@ -447,7 +473,6 @@ local function onReset()
|
||||||
local reset = char:FindFirstChild("Reset")
|
local reset = char:FindFirstChild("Reset")
|
||||||
|
|
||||||
local cf = CFrame.new(roblox)
|
local cf = CFrame.new(roblox)
|
||||||
char:PivotTo(cf)
|
|
||||||
|
|
||||||
goalCF = cf
|
goalCF = cf
|
||||||
prevCF = cf
|
prevCF = cf
|
||||||
|
|
|
@ -80,13 +80,34 @@ character:SetAttribute("TimeScale", 1)
|
||||||
character.DescendantAdded:Connect(onDescendantAdded)
|
character.DescendantAdded:Connect(onDescendantAdded)
|
||||||
character.DescendantRemoving:Connect(onDescendantRemoving)
|
character.DescendantRemoving:Connect(onDescendantRemoving)
|
||||||
|
|
||||||
|
--THIS IS WHERE THE SPAWNLOCATION IMPLEMENTATION IS
|
||||||
|
local function getTeamSpawnPosition(player)
|
||||||
|
local teamColor = player.TeamColor
|
||||||
|
local spawnLocations = game.Workspace:GetDescendants()
|
||||||
|
local teamSpawn = nil
|
||||||
|
|
||||||
|
-- Find a spawn location with the same TeamColor as the player's team
|
||||||
|
for _, spawn in pairs(spawnLocations) do
|
||||||
|
if spawn.ClassName == "SpawnLocation" then
|
||||||
|
if spawn.TeamColor == teamColor then
|
||||||
|
teamSpawn = spawn
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if teamSpawn then
|
||||||
|
return teamSpawn.Position
|
||||||
|
else
|
||||||
|
warn("No spawn location found for team color: " .. tostring(teamColor))
|
||||||
|
return game.workspace:FindFirstChild("SpawnLocation") --default
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local function reload()
|
local function reload()
|
||||||
character:ScaleTo(1)
|
character:ScaleTo(1)
|
||||||
|
|
||||||
task.spawn(function()
|
|
||||||
player:LoadCharacter()
|
|
||||||
end)
|
|
||||||
|
|
||||||
for retry = 1, 10 do
|
for retry = 1, 10 do
|
||||||
local success, result = pcall(function()
|
local success, result = pcall(function()
|
||||||
return Players:GetHumanoidDescriptionFromUserId(userId)
|
return Players:GetHumanoidDescriptionFromUserId(userId)
|
||||||
|
@ -144,4 +165,16 @@ reset.OnServerEvent:Connect(function(player)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
local RunService = game:GetService("RunService")
|
||||||
|
|
||||||
|
function resetter()
|
||||||
|
if character.Humanoid.Health < 1 then
|
||||||
|
reload()
|
||||||
|
wait()
|
||||||
|
player:LoadCharacter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
task.spawn(reload)
|
task.spawn(reload)
|
||||||
|
|
||||||
|
RunService.Heartbeat:Connect(resetter)
|
|
@ -2517,7 +2517,7 @@
|
||||||
"className": "Animation",
|
"className": "Animation",
|
||||||
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"AnimationId": "rbxassetid://14101761759"
|
"AnimationId": "rbxassetid://913384386"
|
||||||
},
|
},
|
||||||
|
|
||||||
"attributes": {
|
"attributes": {
|
||||||
|
@ -2532,7 +2532,7 @@
|
||||||
"className": "Animation",
|
"className": "Animation",
|
||||||
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"AnimationId": "rbxassetid://14101760003"
|
"AnimationId": "rbxassetid://913384386"
|
||||||
},
|
},
|
||||||
|
|
||||||
"attributes": {
|
"attributes": {
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
# Shared - Cloud Assets
|
# sm64-roblox-liberty-prime
|
||||||
|
|
||||||
This folder contains cloud asset mapping for custom Roblox assets that I use in funny 64-bit platformer. The content linked in here does not source from any assets or content from Nintendo. Voice acting was done by me, and animation work was done by Stalkalek. I also borrowed some stock sounds from Roblox.
|
A fork of a port of Super Mario 64's movement code into Roblox Luau (in `--!strict` mode), hosted as a [rojo](https://rojo.space) project. Based on [the SM64 decompilation project](https://github.com/n64decomp/sm64) and [MaximumADHD's Port of movement code to ROBLOX](https://github.com/MaximumADHD/sm64-roblox). This is just a more "ready-to-use" version.
|
||||||
|
|
||||||
|
Original game is hosted here:<br/>
|
||||||
|
https://www.roblox.com/games/10238956318/funny-64-bit-platformer
|
||||||
|
|
||||||
|
## Setting Up & Disclaimers
|
||||||
|
This project follows standard rojo conventions. You should install vscode and install the rojo extension, as well as the rojo plugin for Roblox Studio.
|
||||||
|
|
||||||
|
Any bugs or behavioral quirks of the physics in this are intentional and will not be fixed. **No help will be provided for anything in here. It is NOT intended to be used as a foundation for new games and you're on your own if you choose to do so.**
|
||||||
|
|
||||||
|
## Terms of Use
|
||||||
|
|
||||||
|
You *may* use this in your game, **but you must provide credit** to this repository, MaximumADHD's repository, and the SM64 Decompilation Project. I would **NOT** advise using it as a foundation for a platformer since it's very rigidly tied to the 30hz physics simulation code of Super Mario 64. It's weirdly programmed and not very intuitive to build off of.
|
||||||
|
|
Loading…
Reference in a new issue