Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Help with ShirtTemplate and PantsTemplate?

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"

2 comments

0

Show us the script? or a chunk of it?

0

Updated it with a section

1 answer

✓ Accepted answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.