|
| 12 Jan 2015 11:22 PM |
This script is supposed to check if there is a shirt in the person who clicks the GUI and if there isnt places one there and changes its template, if there is one it just changes its teamplate.
local player = script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid
function onButtonClicked() check = player.Parent:FindFirstChild("Shirt")
if check == nil then shirt = Instance.new("Shirt") player.Parent.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=9261346" else player.Parent.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=9261346" end
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
|
|
|
| Report Abuse |
|
|
|
| 12 Jan 2015 11:23 PM |
You never parented the shirt into the player in the first place. You just created one, which is now sitting in nil.
If life throws you lemons, then throw them back! If Chuck Norris throws you lemons, say, "Thank you!" |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2015 11:25 PM |
| It was one of the problems but didn't fix it. |
|
|
| Report Abuse |
|
|
vacharya
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 511 |
|
|
| 12 Jan 2015 11:30 PM |
local player = script.Parent.Parent.Parent.Parent.Parent function shirtcheck() for _,v in pairs (player.Character:GetChildren()) do if v.ClassName == "Shirt" then v.ShirtTemplate = tostring("http://www.roblox.com/asset/?id=9261346") -- hmm tostring necessary? idk just stayin on the safe side else local newshirt = Instance.new("Shirt",player.Character) newshirt.Name = "Shirt" newshirt.ShirtTemplate = tostring("http://www.roblox.com/asset/?id=9261346") end end end
script.Parent.MouseButton1Down:connect(shirtcheck)
:) |
|
|
| Report Abuse |
|
|