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
1 | function remote.OnServerInvoke(player, TeamName) |
2 | player.TeamColor = BrickColor.new(TeamName) -- Team Change |
3 | if player.TeamColor = = BrickColor.new( "New Yeller" ) then -- Searcher LVL 2 |
4 | player:LoadCharacter() |
thanks you !
01 | local function ChangeClothes(char, shirtid, pantsid) |
02 | local shirt = char:FindFirstChildOfClass "Shirt" or Instance.new( "Shirt" , char) |
03 | local pants = char:FindFirstChildOfClass "Pants" or Instance.new( "Pants" , char) |
04 | shirt.ShirtTemplate = shirtid |
05 | pants.PantsTemplate = pantsid |
06 | end |
07 |
08 | remote.OnServerInvoke = function (player, TeamName) |
09 | player.TeamColor = BrickColor.new(TeamName) |
10 | if TeamName = = "New Yeller" then |
11 | player:LoadCharacter() |
12 | local char = player.Character or player.CharacterAdded:Wait() |
13 | ChangeClothes(char, 263683661 , 317425374 ) --replace with your desired ids |
14 | end |
15 | 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.