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.
groupID = 290188
local remoteEvent = game.ReplicatedStorage.remoteEvent
script.Parent.MouseButton1Click:connect(function(plr)
if plr:IsInGroup(groupID) then
plr.TeamColor = BrickColor.new("Gold")
remoteEvent:FireServer(plr)
end
end)
Then your server script would be something like:
game.ReplicatedStorage.remoteEvent.OnServerEvent:connect(function()
plr.LoadCharacter()
end
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.
3 comments
So i'd need two scripts?
Yes, the local and the normal script, along with the remote event.
Ugh, it doesn't work :C