So I need help with a Team Auto Clother. I don't even know were to start. I am really new to scripting too.
If anyone else is viewing this thread, OP followed this tutorial to figure out how to change teams / shirts of the teams by using this tutorial
Instead of changing the player's clothes every time the player reset, BMA wanted the player's clothes to change whenever the player clicked a button.
We had to use remote events to change the player's team after they clicked a button.
We created a remote event called ChangeTeam
which was fired whenever the player clicked the button to change their team.
The code for this was inside a localscript inside the button that the player was supposed to click:
changeTeam = game.ReplicatedStorage.ChangeTeam script.Parent.MouseButton1Click:Connect(function() changeTeam:FireServer("Team2") --tell the server that we want to change the player's team to team2 by firing a remote event with the name of the team we want to change the player's team to end)
Once we fired the remote event, we changed the team on the server:
--changes the players team changeTeam = game.ReplicatedStorage.ChangeTeam changeTeam.OnServerEvent:Connect(function(player, teamToChangeTo) player.Team = game.Teams[teamToChangeTo] end)
we also had a function on the server to change the players clothes whenever their team changed:
game.Players.PlayerAdded:Connect(function(player) --this function changes the player's clothes when their team changes player:GetPropertyChangedSignal("Team"):Connect(function() local character = player.Character if(player.Team == game.Teams["Team1"] then character:WaitForChild("Shirt").ShirtTemplate = "http://www.roblox.com/asset/?id=(ID HERE)" character:WaitForChild("Pants").PantsTemplate = "http://www.roblox.com/asset/?id=(ID HERE)" end end) --this function makes sure the player's clothes changes whenever they resets / joins the game player.CharacterAdded:Connect(function(character) local character = player.Character if(player.Team == game.Teams["Team1"] then character:WaitForChild("Shirt").ShirtTemplate = "rbxassetid://(your asset id here)" character:WaitForChild("Shirt").PantsTemplate= "rbxassetid://(your asset id here)" end end) end)