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

Why does this work for other players but not me? (The owner)

Asked by
Nidoxs 190
9 years ago

This spawns everyone in the group to the right team but me? Why?

function Enter(newPlayer) if newPlayer:IsInGroup(2608221) then newPlayer.TeamColor = script.Parent.TeamColor end game.Players.ChildAdded:connect(Enter)
0
You should fix your hierarchy. rexbit 707 — 9y

1 answer

Log in to vote
0
Answered by
xAtom_ik 574 Moderation Voter
9 years ago

Question: Where is the script placed?

Missed Things:

'end' required at the end of if function 'if newPlayer:IsInGroup(2608221) then'

Optional:

Consider changing 'ChildAdded' for 'PlayerAdded'

Script

I have not tested this script, give it a go, reply if it works!

function Enter(newPlayer) 
wait()
if newPlayer:IsInGroup(2608221) then 
    newPlayer.TeamColor = script.Parent.TeamColor 
end 
end
game.Players.PlayerAdded:connect(Enter)
Ad

Answer this question