|
| 23 Nov 2013 04:23 PM |
I'm making a morph script. CODE_START local ShirtId = "129000815" -- Change inside the quotes to the ID of the shirt you want local PantsId = "129001983" -- Change inside the quotes to the ID of the pants you want
function ChangeShirtPants(bla) checkshirt = hit.Parent:FindFirstChild(Shirt) checkpants = hit.Parent:FindFirstChild(Pants) if checkshirt == nil then print ("No shirt detected") s = Instance.new("Shirt", hit.Parent) s.ShirtTemplate = "http://web.roblox.com/?id=" + ShirtId else checkshirt.ShirtTemplate = "http://web.roblox.com/?id=" + ShirtsId end if checkpants == nil then print ("No pants detected") p = Instance.new("Pants", hit.Parent) p.PantsTemplate = "http://web.roblox.com/?id=" + PantsId else checkpants.PantsTemplate = "http://web.roblox.com/?id=" + PantsId end end
script.Parent.Touched:connect(ChangeShirtPants(bla)) CODE_END Output: error: attempted to index bla (a nil value) |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2013 04:33 PM |
script.Parent.Touched:connect(ChangeShirtPants(bla))
It might be trying to pass bla through to the function here. You don't need to explicitly state the input of a touched connection here. Try
script.Parent.Touched:connect(ChangeShirtPants())
But keep your input name in your function when it is declared. |
|
|
| Report Abuse |
|
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 23 Nov 2013 04:34 PM |
| Change all occurrences of hit to bla or vice versa. |
|
|
| Report Abuse |
|
|
|
| 23 Nov 2013 05:34 PM |
M I edited that In the original script, it's all hit.
XD |
|
|
| Report Abuse |
|
|