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?

3 comments

0

what type of script is this

0

It's suppose to move the character to one of four spots on the map every time they spawn.

0

Also it's a regular script in serverscriptservice