Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why it don't make the player change team?

g = script.Parent -- g is actually the folder in which the script is and g is in ServerStorage
plr = g.Parent.Parent
wait(.5)
if plr:IsInGroup(1085813) then  --Group ID
	plr.TeamColor = BrickColor.new("White")
else
	plr.TeamColor = BrickColor.new("Pearl")
end

2 comments

0

Only Local Scripts can use LocalPlayer.

0

I've already realized it, but thanks.

1 answer

✓ Accepted answer

ServerStorage's do not run scripts. If you want to however make it change teams upon join, here is the proper coding.

Script Location: ServerScriptService

game.Players.PlayerAdded:connect(function(plr)
	if plr:IsInGroup(1085813) then 
	    plr.TeamColor = BrickColor.new("White")
	else
	    plr.TeamColor = BrickColor.new("Pearl")
	end
end)

I hope that helped. :)

1 comment

0

That helped! Thanks :D

This discussion is preserved as it was. New answers, comments, and votes are closed.