generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Need some help with onClicked script.

Previous Thread :: Next Thread 
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
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
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
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
iJacobness is not online. iJacobness
Joined: 20 Jan 2014
Total Posts: 4944
25 Jun 2016 02:48 PM
click detectors dont work with FE


r+://393244197r+://393244224r+://393244262
Report Abuse
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
25 Jun 2016 02:50 PM
Would it be possible to use a custom click Detector for it to work?
Report Abuse
Funkylegoman is not online. Funkylegoman
Joined: 18 Sep 2010
Total Posts: 1385
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
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
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
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
25 Jun 2016 02:55 PM
Thanks, it was kind of for me. Haven't scripted for ages.
Report Abuse
Funkylegoman is not online. Funkylegoman
Joined: 18 Sep 2010
Total Posts: 1385
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
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
25 Jun 2016 02:57 PM
Still something wrong in your fix. Won't get it to work.
Report Abuse
Tewuilla509 is not online. Tewuilla509
Joined: 02 Jan 2012
Total Posts: 11
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image