|
| 29 Aug 2011 11:14 AM |
| I want to make a button activated door for my HQ but I don't know how. Please help. Thanks :D |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 11:20 AM |
| You want it to open and close or apart |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 11:30 AM |
Ok, heres what you do: Get a brick, name it door, Get two smaller bricks, make one open, and once close (green and red) Insert this script into open: function onClicked() script.Parent.Parent.Door.Transparency=0.5 script.Parent.Parent.Door.CanCollide=false end script.Parent.ClickDetector.MouseClick:connect(onClicked)
and put a click detector into open.
Then do the same with close, but put this script in: function onClicked() script.Parent.Parent.Door.Transparency=0 script.Parent.Parent.Door.CanCollide=true end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Then group the open and close switches and the door togther.
|
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 11:37 AM |
| Or you can use my 402 line door in my models, It's really smooth. |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
| |
|
|
| 29 Aug 2011 11:39 AM |
Hmmm... too complicated(2 Buttons with a different effect :O)
Use this script too open and close with one script(Use only one button)
debonce = true B = script.Parent D = script.Parent.Parent.Door
function OpenDoor() if debounce then
D.Transparency = 0.5 D.CanCollide = false B.BrickColor = BrickColor.new("Bright red") debounce = false
else
D.Transparency = 0 D.CanCollide = true B.BrickColor = BrickColor.new("Bright green") debounce = true end end B.ClickDetector.MouseClick:connect(OpenDoor)
this way...
|
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 11:39 AM |
| woops sorry firs line debounce = true |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 11:40 AM |
| Its not a button door if you dont use a button to clos it. lol |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 11:44 AM |
| You do u use the same button to open and close |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 11:50 AM |
Hmm, button doors that close after a time would be cooler, like in EW bases,
EG:
function onClicked() script.Parent.Parent.Door.Transparency=0 script.Parent.Parent.Door.CanCollide=true end script.Parent.ClickDetector.MouseClick:connect(onClicked)
wait: (3) script.Parent.Parent.Door.Transparency=1 script.Parent.Parent.Door.CanCollidefalse end
|
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 11:51 AM |
shouldn't that be like this (idk if yours works i never do it that way)
function onClicked() script.Parent.Parent.Door.Transparency=0 script.Parent.Parent.Door.CanCollide=true wait(3) script.Parent.Parent.Door.Transparency=1 script.Parent.Parent.Door.CanCollide = false end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 11:55 AM |
| I didnt try, I just made it up, but your one would probaly work |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 12:16 PM |
| Should he be even looking to the scripts we gave? |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 12:21 PM |
Oh yeah wait if you use my button twice there should be a few changes call 1 button Button1 and the other Button2
Button1 beneath the script
local function Fix() if script.Parent.Parent.Button2.BrickColor = BrickColor.new("Bright green") then debounce = false script.Parent.BrickColor = BrickColor.new("Bright red") elseif script.Parent.Parent.Button2.BrickColor = BrickColor.new("Bright red") then debounce = true script.Parent.BrickColor = BrickColor.new("Bright green") end end script.Parent.ClickDetector.MouseClick:connect(Fix)
In button2
local function Fix() if script.Parent.Parent.Button1.BrickColor = BrickColor.new("Bright green") then debounce = false script.Parent.BrickColor = BrickColor.new("Bright red") elseif script.Parent.Parent.Button1.BrickColor = BrickColor.new("Bright red") then debounce = true script.Parent.BrickColor = BrickColor.new("Bright green") end end script.Parent.ClickDetector.MouseClick:connect(Fix)
That should do
|
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 12:35 PM |
| There are going to be alot of noobs stealing that script..... |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 12:37 PM |
Well yeah, then they do so, maybe i typed something wrong making or well the script does nothing, or well making an action not happening
Maybe i don't know i made it once but i just typed this one here so |
|
|
| Report Abuse |
|
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 12:46 PM |
| I just learned scripting, but I learnt by looking in the scripts of free models. lol. |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2011 12:52 PM |
Yeah that's a good way to learn. In the past wiki was too but it changed a lot... |
|
|
| Report Abuse |
|
|
| |
|
| |
|
31drake
|
  |
| Joined: 10 Dec 2010 |
| Total Posts: 341 |
|
|
| 29 Aug 2011 02:25 PM |
| NP, gets my posts up... jk, I like helping :) |
|
|
| Report Abuse |
|
|
| |
|