Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make players respawn once when they join the game?

So I basically made a game for a group. It has different teams. Such as Criminal, Outsider, Military and Villagers. I added a script that makes sure the people get auto teamed.

function onPlayerEntered(plyr) if plyr:IsInGroup(5084542) then plyr.TeamColor = BrickColor.new("Institutional white") end end

game.Players.PlayerAdded:connect(onPlayerEntered)

The only problem is, that when they spawn. They spawn in the criminal spawn. But if you reset you spawn on the correct place. So, who has a script that makes you respawn once when you join the game? Or do you have a different solution?

1 comment

0

Please use the Lua text box

1 answer

Please use Lua text box but here is a solution anyways:

local function onPlayerEntered(plyr) 
	if plyr:IsInGroup(5084542) then 
		plyr.TeamColor = BrickColor.new("Institutional white")
		wait(1)
		plyr:LoadCharacter()
	end
end

game.Players.PlayerAdded:Connect(onPlayerEntered)

1 comment

0

Or increase the wait time if this is not enough

This discussion is preserved as it was. New answers, comments, and votes are closed.