Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can you help me change the clothes ?

Asked by 7 years ago

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

1function remote.OnServerInvoke(player, TeamName)
2    player.TeamColor = BrickColor.new(TeamName) -- Team Change
3if player.TeamColor == BrickColor.new("New Yeller") then -- Searcher LVL 2
4            player:LoadCharacter()

thanks you !

0
The question sounds like you need help changing your clothes* :P | Be more specific in the title. Jo_Bot 67 — 7y
0
XD , sorry for that sheppard929 9 — 7y

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
7 years ago
01local 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
06end
07 
08remote.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
15end

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.

0
Thanks you so much ! its working :D sheppard929 9 — 7y
0
and... small question , if i want remove all hats and add a new one , how i can do this ? sheppard929 9 — 7y
Ad

Answer this question