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

How can I make the person forcefully respawn after changing teams? [WORKING]

Asked by 4 years ago
Edited 4 years ago

This question has been solved by the original poster.

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.

0
What do you mean forcefully Nguyenlegiahung 1091 — 4y
0
I think you can use player:LoadCharacter() this respawns the character. bostaffmanbulgaria1 89 — 4y
0
Yeah :LoadCharacter() works Spjureeedd 385 — 4y

Answer this question