tool = script.Parent
handle = tool:WaitForChild("Handle")
local player = game.Players.LocalPlayer
tool.Activated:Connect(function()
player.TeamColor = game.Teams.Customer.TeamColor
end)
✓ ANSWER ACCEPTED
Why wont tool change players team?
1 answer
✓ Accepted answer
You might wanna make a remote event, if this is a local script. Anyway if it is:
Step one - make a remote event in replicated storage and name it however you like.
Step two - add a local script inside a tool and put this:
local tool = script.Parent
local remote = game.ReplicatedStorage.YourRemote
tool.Activated:Connect(function()
--we will now send to the script the team we want the player to be.
remote:FireServer(game.Teams.YourTeam)
end)
Step three - add a server script in server script service and add this:
local remote = game.ReplicatedStorage.YourRemote
remote.OnServerEvent:Connect(function(plr, team)
plr.TeamColor = team.TeamColor
plr.Team = team
end)
and you are done! Comment if there are any errors.
This discussion is preserved as it was. New answers, comments, and votes are closed.
