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

Help with ShirtTemplate and PantsTemplate?

Asked by 8 years ago

I did a normal script that changes the IDs of the two, and in studio, it works fine. However, in-game the shirt/pants do not change when the script is initiated.

It is not a local script.

Any help?

player.Character.Shirt.ShirtTemplate="http://www.roblox.com/asset/?id=256529964" player.Character.Pants.PantsTemplate="http://www.roblox.com/asset/?id=166571829" player.Character.Head.BrickColor=BrickColor.new("Pastel brown") player.Character.Head.face.Texture="http://www.roblox.com/asset/?id=86157358"

0
Show us the script? or a chunk of it? Vezious 310 — 8y
0
Updated it with a section Huminoidjoe 20 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

You haven't defined player, and if you want this script to run when someone joins you need to enclose it in a function.

game.Players.PlayerAdded:connect(function(player)
    local shirt = player.Character:FindFirstChild("Shirt")
    local pants = player.Character:FindFirstChild("Pants")
    local head = player.Character:FindFirstChild("Head")
    if shirt then
        shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=256529965" 
    if pants then
        pants.PantsTemplate = "http://www.roblox.com/asset/?id=166571830"
     if head then
        head.BrickColor = BrickColor.new("Pastel brown")
        head.face.Texture = "http://www.roblox.com/asset/?id=86157358"
end end end end)
Ad

Answer this question