I’m trying to make a backrooms game (as always i’m making a game lol) but when a char dies, it is supposed to go to the level run to the exit, but for some reason i can’t get them to teleport, and i don’t know why, i also have searched SEVERAL, i repeat, SEVERAL posts that has this problem, no one of those helped me.
You could try to make your own spawning logic by disabling CharacterAutoLoads from StarterPlayer. And each time you load the character, just reposition it. Make sure you have the list of positions ready through one means or another.
For the logic of knowing when the character is loaded, check for Player.CharacterAdded event.
local part = --- put the part here
game.Players.PlayerAdded:Connect(function(plr)
local char = plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
wait(game:GetService("Players").RespawnTime + 0.25)
char:PivotTo(part.CFrame)
end)
end)
try this
Assuming your level is in the same universe as your base levels, you can use a property in the player instance called; “RespawnLocation”. It’s an object property which you can later on set to a spawnlocation in your death level and the player will spawn in that room. This also won’t use any confusing code!
local Players = game:GetService("Players")
local spawnArray = {} -- this is an array of spawns
Players.PlayerAdded:Connect(function(player)
local function onCharacterAdded(character)
local humanoid = character.Humanoid
-- positioning method / spawn setter
character:PivotTo(spawnArray[math.random(#spawnArray)].CFrame)
humanoid.Died:Connect(function()
task.wait(Players.RespawnTime + 0.25)
player:LoadCharacter()
end)
end
player.CharacterAdded:Connect(onCharacterAdded)
player:LoadCharacter() -- assuming CharacterAutoLoads is disabled
end)