Hey SH, I'm editing a script for group use, the game has multiple teams with the same team color (not my choice but eh), the teams are different groups so I'd like to additionally make it so that the script functions on death/respawn as well as on entry. It works right when you first load in, it doesn't work after subsequent respawns.
Here's the script down below, what do I need to change for this to work? Thank you!
local groupId = 946493
function RegisterPlayer( player )
if CheckInGroup(player, groupId) then
HoldThreadForCharacter(player)
player.Character:MoveTo(script.Parent.Position + Vector3.new(0,3,0))
end
end
function CheckInGroup( player, id )
if player:IsInGroup(id) then
return true
end
return false
end
function HoldThreadForCharacter( player )
repeat wait() until Workspace:FindFirstChild(player.Name)
end
Game.Players.PlayerAdded:connect(RegisterPlayer)
for i,v in pairs(Game.Players:GetPlayers()) do
RegisterPlayer(v)
end

2 comments
use player.CharacterAdded
Hey, thank you for the response. What line(s) would I edit with?