hello, i am a beginner of scripting, but i don't know how to change cloth of the player, i want to put the line under player:LoadCharacter() (the value of the player is... player x) )
script
function remote.OnServerInvoke(player, TeamName) player.TeamColor = BrickColor.new(TeamName) -- Team Change if player.TeamColor == BrickColor.new("New Yeller") then -- Searcher LVL 2 player:LoadCharacter()
thanks you !
local function ChangeClothes(char, shirtid, pantsid) local shirt = char:FindFirstChildOfClass"Shirt" or Instance.new("Shirt", char) local pants = char:FindFirstChildOfClass"Pants" or Instance.new("Pants", char) shirt.ShirtTemplate = shirtid pants.PantsTemplate = pantsid end remote.OnServerInvoke = function(player, TeamName) player.TeamColor = BrickColor.new(TeamName) if TeamName == "New Yeller" then player:LoadCharacter() local char = player.Character or player.CharacterAdded:Wait() ChangeClothes(char, 263683661, 317425374) --replace with your desired ids end end
Btw you should add additional security measures to ensure that exploiters can't use your remote function to assign themselves into any team they want.