I want to know how I can forcefully make the player respawn after changing to their respective team.

game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(msg)
local check = string.lower(msg)
if string.sub(check,1,5) == "join/" then
for i, v in ipairs(game.Teams:GetChildren()) do
if string.find(v.Name:lower(),string.sub(msg:lower(),6)) then
p.TeamColor = v.TeamColor 
end
end
end
end)
end)

Edit: I thought I'd ask after a while of struggling, but with persistence, I found out how to forcefully respawn the player.

3 comments

0

What do you mean forcefully

0

I think you can use player:LoadCharacter() this respawns the character.

0

Yeah :LoadCharacter() works