|
| 19 Feb 2012 02:08 PM |
I forgot how to connect functions without a connection line. How do you do it? Like:
script.Parent.Touched:connect(function blab() print "Blab" end) |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 02:10 PM |
The first line basically is the connection line.
script.Parent.Touched:connect(function(blab) print("blab") end)
† KMXD † |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Feb 2012 02:23 PM |
| OH, I see what I was doing wrong. Thanks! :D |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Feb 2012 03:25 PM |
script.Parent.Touched:connect(function(hit) if hit.Parent.Parent:findFirstChild("Humanoid") ~= nil then for i = 1,0,-.1 do hit.Transparency = i wait(0.1) end hit:remove() end)
My script gives me this:
Workspace.Building.Acids.Acid.Script:8: unexpected symbol near ')'
What'd I do wrong?
|
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 03:28 PM |
Try:
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then for i = 1, 0, -0.1 do hit.Transparency = i wait(0.1) end hit:Destory() end end)
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 03:28 PM |
Ah, my fault. Try:
script.Parent.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then for i = 1, 0, -0.1 do hit.Transparency = i wait(0.1) end hit:Destroy() end end)
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 03:30 PM |
| What exactly did I do wrong, and what was changed? |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 03:31 PM |
Not much, I just tidied it a bit. The real problem is that you missed an end.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 03:32 PM |
| Oh. I swear, the output needs to be more specific. |
|
|
| Report Abuse |
|
|
| |
|