groupID = 290188 script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayer:IsInGroup(groupID) then game.Players.LocalPlayer.TeamColor = BrickColor.new("Gold") game.Players.LocalPlayer:LoadCharacter() end end)
This is what I have, it works in Studio, but doesn't work live. From what I heard, LoadCharacter() only works in Server Scripts, but I can't access LocalPlayer in a Server Script.
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 -- any location really 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.