|
| 25 Jun 2016 02:39 PM |
Hey guys, I recently tried to script some flowing water that's opened from a button. I tried the script, but it would not work. Here's the whole thing:
http://prntscr.com/bkzxrh
and here's the raw copy data:
function onClicked(playerWhoClicked) workspace.Parent.Water1.Transparency = 0 wait(0.25) script.Parent.Water2.Transparency = 0 wait(0.25) script.Parent.Water3.Transparency = 0 wait(0.25) script.Parent.Water4.Transparency = 0 wait(0.25) script.Parent.Water5.Transparency = 0 wait(0.25) script.Parent.Water6.Transparency = 0 wait(0.25) script.Parent.Water7.Transparency = 0 wait(0.25) script.Parent.Water8.Transparency = 0 wait(0.25) script.Parent.Water9.Transparency = 0 wait(5) script.Parent.Water1.Transparency = 1 wait(0.25) script.Parent.Water2.Transparency = 1 wait(0.25) script.Parent.Water3.Transparency = 1 wait(0.25) script.Parent.Water4.Transparency = 1 wait(0.25) script.Parent.Water5.Transparency = 1 wait(0.25) script.Parent.Water6.Transparency = 1 wait(0.25) script.Parent.Water7.Transparency = 1 wait(0.25) script.Parent.Water8.Transparency = 1 wait(0.25) script.Parent.Water9.Transparency = 1 wait(0.25) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Does anyone know what I am doing wrong? Thanks in advance.
|
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:44 PM |
Also, the workspace at the first operation was actually meant to be script. so instead of
workspace.Parent.Water1.Transparency = 0
it would be
script.Parent.Water.Transparency = 0 |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:48 PM |
click detectors dont work with FE
r+://393244197r+://393244224r+://393244262 |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:50 PM |
| Would it be possible to use a custom click Detector for it to work? |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:54 PM |
script.Parent.ClickDetector.MouseClick:connect(function(clicked) workspace.Parent.Water1.Transparency = 0 wait(0.25) script.Parent.Water2.Transparency = 0 wait(0.25) script.Parent.Water3.Transparency = 0 wait(0.25) script.Parent.Water4.Transparency = 0 wait(0.25) script.Parent.Water5.Transparency = 0 wait(0.25) script.Parent.Water6.Transparency = 0 wait(0.25) script.Parent.Water7.Transparency = 0 wait(0.25) script.Parent.Water8.Transparency = 0 wait(0.25) script.Parent.Water9.Transparency = 0 wait(5) script.Parent.Water1.Transparency = 1 wait(0.25) script.Parent.Water2.Transparency = 1 wait(0.25) script.Parent.Water3.Transparency = 1 wait(0.25) script.Parent.Water4.Transparency = 1 wait(0.25) script.Parent.Water5.Transparency = 1 wait(0.25) script.Parent.Water6.Transparency = 1 wait(0.25) script.Parent.Water7.Transparency = 1 wait(0.25) script.Parent.Water8.Transparency = 1 wait(0.25) script.Parent.Water9.Transparency = 1 wait(0.25) end)
That's all, was that so hard? |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:54 PM |
| I was thinking of putting in a LocalScript and RemoteEvent in, but this would not work for everyone, meaning that only I would see the water flow if I'd press the button. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:55 PM |
| Thanks, it was kind of for me. Haven't scripted for ages. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:57 PM |
Actually i was inspecting your script and i saw this..
> "function onClicked(playerWhoClicked)
but your final line is "script.parent.ClickDetector.MouseClick:connect(onClicked)
The problem is that you wrote "onClicked" at the end instead of playerWhoClicked..!
In case that's not the problem use my script i provided you with. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 02:57 PM |
| Still something wrong in your fix. Won't get it to work. |
|
|
| Report Abuse |
|
|
|
| 25 Jun 2016 03:03 PM |
I've tried your script, but it wouldn't work. I thought about your script (top line) and saw this; (function(clicked) doesn't it have to be (function(onClicked) ?
|
|
|
| Report Abuse |
|
|