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 » Scripting Helpers
Home Search
 

Re: What's wrong with this script?

Previous Thread :: Next Thread 
ghostblocks is not online. ghostblocks
Joined: 21 Oct 2010
Total Posts: 163
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 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
06 Feb 2014 05:03 PM
you called onClicked but your function is onCLick
Report Abuse
ThrashingThunder is not online. ThrashingThunder
Joined: 03 Oct 2011
Total Posts: 2388
06 Feb 2014 05:04 PM
:connect(onClicked) should be :connect(onClick)

It does not match the function name.
Report Abuse
SecondaryZero is not online. SecondaryZero
Joined: 22 Nov 2013
Total Posts: 162
06 Feb 2014 05:08 PM
Uncap the script
Report Abuse
ghostblocks is not online. ghostblocks
Joined: 21 Oct 2010
Total Posts: 163
06 Feb 2014 05:13 PM
I edited it, it still doesn't work. Any other suggestions?
Report Abuse
LilJoker4675 is not online. LilJoker4675
Joined: 31 Oct 2011
Total Posts: 220
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
Scriptural is not online. Scriptural
Joined: 06 Sep 2013
Total Posts: 2979
06 Feb 2014 05:14 PM
Ignore @Lil
Thats not even close.
Report Abuse
LilJoker4675 is not online. LilJoker4675
Joined: 31 Oct 2011
Total Posts: 220
06 Feb 2014 05:15 PM
Oh really? I know my scripting... I just changed the function to A REAL FUNCTION.
Report Abuse
ghostblocks is not online. ghostblocks
Joined: 21 Oct 2010
Total Posts: 163
06 Feb 2014 05:17 PM
Still isn't working, what is wrong with it?
Report Abuse
dodleman is not online. 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
LilJoker4675 is not online. LilJoker4675
Joined: 31 Oct 2011
Total Posts: 220
06 Feb 2014 05:19 PM
Oh, thanks, I don't work much with click detectors.
Report Abuse
ghostblocks is not online. ghostblocks
Joined: 21 Oct 2010
Total Posts: 163
06 Feb 2014 05:19 PM
@dodleman Then what is wrong with it?
Report Abuse
dodleman is not online. dodleman
Joined: 22 Dec 2007
Total Posts: 1118
06 Feb 2014 05:19 PM
mhm.

Life is potatoes to me
Report Abuse
dodleman is not online. 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
ghostblocks is not online. ghostblocks
Joined: 21 Oct 2010
Total Posts: 163
06 Feb 2014 05:22 PM
Thanks
Report Abuse
Perci1 is not online. 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 is not online. dodleman
Joined: 22 Dec 2007
Total Posts: 1118
06 Feb 2014 05:22 PM
Yep

Life is potatoes to me
Report Abuse
dodleman is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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