Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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?

0
Please use the Lua text box Just2Terrify 566 — 5y

1 answer

Log in to vote
0
Answered by
karlo_tr10 1233 Moderation Voter
5 years ago

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)
0
Or increase the wait time if this is not enough karlo_tr10 1233 — 5y
Ad

Answer this question