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
 

OnClicked Door

Previous Thread :: Next Thread 
caca22 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:13 PM
Ok So I made a button and a door In one model And Put this script in the button...

fuction Onclicked()
wait(0.5)
script.Parent.Bob.CanCollide = False
script.Parent.Bob.Transparency = 1
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)



Whats Wrong with it?
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
07 Aug 2011 10:14 PM
The name of the function is 'Onclicked', but in the connection line, you're saying that you want a function named 'onClicked' to fire. These two are not the same, and they should be.

[Insert squiggles here][Say something humorous here][More squiggles go here]
Report Abuse
leolion113 is not online. leolion113
Joined: 11 Oct 2008
Total Posts: 3336
07 Aug 2011 10:15 PM
fuction onClicked()
wait(0.5)
script.Parent.Bob.CanCollide = false
script.Parent.Bob.Transparency = 1
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
caca22 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:16 PM
Thanks to both of you
Report Abuse
scrat101 is not online. scrat101
Joined: 26 Jan 2009
Total Posts: 331
07 Aug 2011 10:17 PM
for one, the word function is misspelled. Second, the function name you put in the connection is wrong, capitalize the first letter in the function name in the connection. Then, you should be set as long as there is a ClickDetector in the parent of the script. :D :D :D
Report Abuse
buster925 is not online. buster925
Joined: 05 Jul 2008
Total Posts: 322
07 Aug 2011 10:18 PM
1. Function is spelled wrong
2. Onclicked is actually onClicked
3.on the last line put
script.Parent.ClickDetector.Button1Clicked:connect(onClicked)

hope i helped:)
Report Abuse
buster925 is not online. buster925
Joined: 05 Jul 2008
Total Posts: 322
07 Aug 2011 10:19 PM
wait sorry im late posts came so fast :o
Report Abuse
caca22 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:20 PM
Nvm It still didnt work
Report Abuse
buster925 is not online. buster925
Joined: 05 Jul 2008
Total Posts: 322
07 Aug 2011 10:22 PM
did mine work?
Report Abuse
caca22 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:24 PM
at the end i already have


script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
buster925 is not online. buster925
Joined: 05 Jul 2008
Total Posts: 322
07 Aug 2011 10:25 PM
Oh i got it!
------------------------------
function onButton1Clicked(onClicked)
script.Parent.CanCollide = false
script.Parent.Transparency = 1
end
script.Parent.ClickDetector.Button1Clicked(onClicked)
Report Abuse
caca22 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:29 PM
That wont work Because The parent is the button
Report Abuse
ShoeBox4 is not online. ShoeBox4
Joined: 06 Apr 2011
Total Posts: 890
07 Aug 2011 10:31 PM
@buster925

Isn't the last line supposed to be script.Parent.ClickDetector.MouseButton1Down:connect(onClicked)
Report Abuse
buster925 is not online. buster925
Joined: 05 Jul 2008
Total Posts: 322
07 Aug 2011 10:32 PM
oh i forgot the connect thanks
Report Abuse
caca22 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:33 PM
Im so confused
Report Abuse
buster925 is not online. buster925
Joined: 05 Jul 2008
Total Posts: 322
07 Aug 2011 10:37 PM
ok, try this.
------------------------------------------------------
function onButton1Clicked(onClicked)
script.Parent.CanCollide = false
script.Parent.Transparency = 1
end
script.Parent.ClickDetector.Button1Clicked:connect(onClicked)
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