function respawn(c,s) local spots={'A','B','C','D'} local newspawn = spots[math.random(1,#spots)] c.Torso.CFrame = workspace[s][newspawn].CFrame end game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) respawn(character,'Civilians') end) end)
It works when I run it in dev console as
function respawn(c,s) local spots={'A','B','C','D'} local newspawn = spots[math.random(1,#spots)] c.Torso.CFrame = workspace[s][newspawn].CFrame end respawn(workspace.Rhuxus,'Civilians')
But not in the characteradded
Any idea why?