|
| 06 Jul 2014 11:05 AM |
Just started scripting today, don't know what im doing wrong.
local brick = Workspace.P1
function ontouch(part) brick.Transparency = 0 wait(0.5) brick.Transparency = 0.3 wait(0.5) brick.Transparency = 0.5 wait(0.5) brick.Transparency = 0.7 wait(0.5) brick.Transparency = 0.9 end brick.Touched:connect(onTouch)
chk chk boom |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2014 11:11 AM |
| variables are case sensitive, and you did onTouch when trying to connect the ontouch function. you never defined onTouch so it calls a error when u try to connect it to an event. |
|
|
| Report Abuse |
|
|
Dicentium
|
  |
| Joined: 28 Aug 2011 |
| Total Posts: 18560 |
|
|
| 06 Jul 2014 11:12 AM |
capatilize ontouch in the function
ex : function onTouch(part)
it should work then
since you capatilized this: brick.Touched:connect(onTouch) <- onTouch
but you didn't capatilize this: function ontouch(part) <- ontouch
|
|
|
| Report Abuse |
|
|
|
| 06 Jul 2014 12:56 PM |
| Output log would've been useful for this, but yeah the poster above me is right. |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2014 02:53 PM |
"local brick = Workspace.P1
function ontouch(part) brick.Transparency = 0 wait(0.5) brick.Transparency = 0.3 wait(0.5) brick.Transparency = 0.5 wait(0.5) brick.Transparency = 0.7 wait(0.5) brick.Transparency = 0.9
end brick.Touched:connect(onTouch)"
I think it's because brick was defined locally, and also, you never used the argument.
local brick = Workspace.P1
function ontouch(part) part.Transparency = 0 wait(0.5) part.Transparency = 0.3 wait(0.5) part.Transparency = 0.5 wait(0.5) part.Transparency = 0.7 wait(0.5) part.Transparency = 0.9
end brick.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|