Im trying to make a script so when you click a GUI it will put shirts and pants on your character
This is what I have right now
01 | shirtid = "http://www.roblox.com/asset/?id=146978987" |
02 | pantsid = "http://www.roblox.com/asset/?id=54361253" |
03 | button = script.Parent |
04 |
05 | button.MouseButton 1 Click:conect( function () |
06 | if hit.Parent:findFirstChild( "Humanoid" ) then |
07 | char = hit.Parent |
08 | if char:findFirstChild( "Shirt" ) then |
09 | char.Shirt.ShirtTemplate = shirtid |
10 | else |
11 | a = Instance.new( "Shirt" , char) |
12 | a.Name = "Shirt" |
13 | a.ShirtTemplate = shirtid |
14 | end |
15 | if char:findFirstChild( "Pants" ) then |
Here, I can fix it up a little bit:
01 | --Put this in a local script inside the textbutton |
02 | shirtid = "http://www.roblox.com/asset/?id=146978987" |
03 | pantsid = "http://www.roblox.com/asset/?id=54361253" |
04 | button = script.Parent |
05 |
06 | button.MouseButton 1 Click:conect( function () |
07 | player = game.Players.LocalPlayer |
08 | char = player.Character |
09 | if char:findFirstChild( "Shirt" ) then |
10 | char.Shirt.ShirtTemplate = shirtid |
11 | else |
12 | a = Instance.new( "Shirt" , char) |
13 | a.Name = "Shirt" |
14 | a.ShirtTemplate = shirtid |
15 | end |