Answered by
8 years ago Edited 8 years ago
You could try RemoteEvents which you can pass the plr argument which you declare in the function at line 4.
That'd require a new script and a remote event though, and your local script would like something like this.
2 | local remoteEvent = game.ReplicatedStorage.remoteEvent |
4 | script.Parent.MouseButton 1 Click:connect( function (plr) |
5 | if plr:IsInGroup(groupID) then |
6 | plr.TeamColor = BrickColor.new( "Gold" ) |
7 | remoteEvent:FireServer(plr) |
Then your server script would be something like:
1 | game.ReplicatedStorage.remoteEvent.OnServerEvent:connect( function () |
That's the long way of doing it, and there's probably another function or a fix out there to load character easier. But hey, this is a way to learn.
I'm also a very new scripter, so I could VERY well be wrong there, but I believe that'll work out well.