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

Can someone tell me why this wont give me the new shirt,pants, hats to the players?

Asked by
Krlos21 45
10 years ago
assets={}
    assets.Shirt{90415298,114883953,140974162,81050287,112047296,92448971} --Shirts
    assets.Pants{65160698,89224181,67492557 } 
    assets.Hats= game.Lighting.Hats:GetChildren() -- hats go in a model under lighting called Hats

player =  game.Players.LocalPlayer -- gets the player
a = player .Character:GetChildren() -- Gets parts used for cleaning

function Clear() -- Removes hats Character meshes shirts and pants also T-shirts
for xX = 1,#a do
    if a[xX].ClassName=="Hat" or a[xX].ClassName=="CharacterMesh" or a[xX].ClassName=="Shirt" or  a[xX].ClassName=="Pants" or a[xX].ClassName=="ShirtGraphic" then
        a[xX]:Destroy()

    elseif a[xX].ClassName=="Part" and a[xX].Name~="HumanoidRootPart" then a[xX].Transparency = 0 
     end
    end
  end

Clear() -- Cleans the player
wait()
Shirt = Instance.new("Shirt",player.Character)
pants = Instance.new("Pants",player.Character) pants.Name = "Pants"
hat = assets.Hats[math.random(1,#assets.Hats)]:Clone()
Shirt.ShirtTemplate = "rbxassetid://" .. assets.Shirt[math.random(1,#assets.Shirt)]
pants.PantsTemplate = "rbxassetid://" .. assets.Pants[math.random(1,#assets.Pants)]
hat.Parent = player.Character 

I used this script in LocalScript inside StarterGUI but it wont work please help

Answer this question