|
| 30 Jul 2011 02:35 PM |
I'm not a scripting "noob." I can correctly script a simple model and make it work. Well, I was trying to make a button door. One where you click the red button to close it and the green button to open it. I scripted it correctly, but I still can't get it to work. And yes, I did use a ClickDetector. Here are the scritps:
Close Script:
function onClicked() script.Parent.Parent.Door.Transparency= 0 script.Parent.Parent.Door.CanCollide= true end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Open Script:
function onClicked() script.Parent.Parent.Door.Transparency= 0.4 script.Parent.Parent.Door.CanCollide= false
script.Parent.ClickDetector.MouseClick:connect(onClicked)
I can't see what's wrong with them. Do I have to pause the game when scripting it for it to work? I've tried saving it as a model, leaving the studio and re-entering it. I've also tried it on Test. I did it on build mode. Do I have to go on edit?
Any help will be much appreciated. I want to learn to use as little free models as possible. They take the fun out of building and almost always give you a virus! |
|
|
| Report Abuse |
|
|
GigsD4X
|
  |
| Joined: 06 Jun 2008 |
| Total Posts: 3794 |
|
| |
|
MrYofYof
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 29 |
|
| |
|
|
| 30 Jul 2011 02:41 PM |
| I tried reading about output on the Wiki. Could you explain how to use it, or what it is? Sorry if I'm sounding like a complete noob; it's better to ask than to fail :P |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 02:44 PM |
Your sure there is a clickdetector inside the model you want to open / close?
~~ RT and scripters ~~ |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 02:47 PM |
| Dont worry, I got it to work. I opened output and it pretty much explained itself. The problem was I forgot an 'end' on the green button. Thanks anyway :) |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 03:41 PM |
| GET OUTA THIS FORUM U NEED TO BE SCRIPTER HELPERS :D |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Jul 2011 03:43 PM |
Close script works, but the open one is fixed below:
function onClicked() script.Parent.Parent.Door.Transparency= 0.4 script.Parent.Parent.Door.CanCollide= false end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
-Turtles will hunt you down! |
|
|
| Report Abuse |
|
|
|
| 30 Jul 2011 03:43 PM |
Crusher, you're the guy who said you were a "pre-admin".
-Wiki.roblox.com, the RBX.Lua reference |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2011 10:09 AM |
| i didnt say i was a pre admin... |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 31 Jul 2011 10:13 AM |
@CRUSHER (I got an ITS FREEEEEE voice from your name lol)
*Looks at primary*
*Shove into C&G*
~We don't script, we type random letters, symbols, and numbers then hope it works! |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2011 11:57 AM |
| OMG ABY THE C & G IS ONLY FOR ME AND GIZMOTHEBOO!! |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2011 12:00 PM |
Yes you did, you tried to arrogantly trick me.
-[Insert witty comment here] |
|
|
| Report Abuse |
|
|
| |
|
|
| 31 Jul 2011 01:39 PM |
A year or so ago. :3
-[Insert witty comment here] |
|
|
| Report Abuse |
|
|
|
| 31 Jul 2011 02:47 PM |
| a year ago or so i was hacked ya know... |
|
|
| Report Abuse |
|
|