|
| 06 Feb 2014 05:02 PM |
function onClick() Script.Parent.Transparency = 0.5 Script.Parent.CanCollide = true wait (3) Script.Parent.Transparency = 0 Script.Parent.CanCollide = false end script.Parent.ClickDetector.MouseClick:connect(onClicked)
It's one of my first tries at making my own simple script, and I already have a click detector in the brick. I'm new to Lua, please help. |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 06 Feb 2014 05:03 PM |
| you called onClicked but your function is onCLick |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:04 PM |
:connect(onClicked) should be :connect(onClick)
It does not match the function name. |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Feb 2014 05:13 PM |
| I edited it, it still doesn't work. Any other suggestions? |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:14 PM |
function onClick() Script.Parent.Transparency = 0.5 Script.Parent.CanCollide = true wait (3) Script.Parent.Transparency = 0 Script.Parent.CanCollide = false end script.Parent.ClickDetector.MouseButton1Down:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:14 PM |
Ignore @Lil Thats not even close. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:15 PM |
| Oh really? I know my scripting... I just changed the function to A REAL FUNCTION. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:17 PM |
| Still isn't working, what is wrong with it? |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 06 Feb 2014 05:18 PM |
MouseClick is for clickdetectors. Also, if you knew anything, you'd know it's called an event. XD
Btw, you still didn't fix the connection so you know nothing.
Life is potatoes to me |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:19 PM |
| Oh, thanks, I don't work much with click detectors. |
|
|
| Report Abuse |
|
|
|
| 06 Feb 2014 05:19 PM |
| @dodleman Then what is wrong with it? |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 06 Feb 2014 05:19 PM |
mhm.
Life is potatoes to me |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 06 Feb 2014 05:20 PM |
script.Parent.ClickDetector.MouseClick:connect(function() script.Parent.Transparency = .5 script.Parent.CanCollide = false wait(3) script.Parent.Transparency = 0 script.Parent.CanCollide = true end)
That should work.
Life is potatoes to me |
|
|
| Report Abuse |
|
|
| |
|
Perci1
|
  |
| Joined: 24 Jan 2011 |
| Total Posts: 1027 |
|
|
| 06 Feb 2014 05:22 PM |
Lil, that event is used with GUIs.
Anyways, it should be this:
function onClick() script.Parent.Transparency = 0.5 script.Parent.CanCollide = true wait(3) script.Parent.Transparency = 0 script.Parent.CanCollide = false end script.Parent.ClickDetector.MouseClick:connect(onClick)
If that doesn't work, add a print() to try to locate the problem. |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
| |
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 06 Feb 2014 05:23 PM |
Already fixed it Perci.
floooood checkkk yoooo!
Life is potatoes to me |
|
|
| Report Abuse |
|
|