NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 08:39 AM |
I am very new to scripting. I decided that OnTouched door was too boring to start with, so I did this. IT is not all one script, it is a whole model with three main bricks, door and two buttons. Each button has a script, I described it best as posible.
--Script for ButtonA (Opening door) function onClicked() script.Parent.BrickColor.new("New Yeller") script.Parent.Parent.Door.Transparency = 1 script.Parent.Parent.Door.CanCollide = false wait(3) script.Parent.BrickColor.new("Bright green") end --End of ButtonA.
script.Parent.ClickDetector.MouseClick:connect(onClicked) --In a different brick. ~ Script for ButtonB (Closing door) function onClicked() script.Parent.BrickColor.new("New Yeller") script.Parent.Parent.Door.Transparency = 0 script.Parent.Parent.Door.CanCollide = true wait(3) script.Parent.BrickColor.new("Bright red") end --End of ButtonB.
script.Parent.ClickDetector.MouseClick:connect(onClicked) --Layout: --Model (The door & all bricks in this script) --Model named "DoorFrame" (Has the frame -Non-important. --Frame1 --Frame2 --Frame3 --Frame4 --Frame5 ~ None of these are involved in script. --ButtonA --ClickDetector --Mesh --Script (For ButtonA) --ButtonB --Mesh --ClickDetector --Script (For ButtonB) --Door (Main part; nothing inside but a BlockMesh.)
-NCISrox |
|
|
| Report Abuse |
|
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 08:48 AM |
Is someone going to help? Or should I just go back to BH? -NCISrox |
|
|
| Report Abuse |
|
|
| |
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
| |
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 08:57 AM |
I only messes that up in the forum. It's fine on the real script. --Script for ButtonA (Opening door) function onClicked() script.Parent.BrickColor.new("New Yeller") script.Parent.Parent.Door.Transparency = 1 script.Parent.Parent.Door.CanCollide = false wait(3) script.Parent.BrickColor.new("Bright green") end script.Parent.ClickDetector.MouseClick:connect(onClicked) --End of ButtonA.
--In a different brick. ~ Script for ButtonB (Closing door) function onClicked() script.Parent.BrickColor.new("New Yeller") script.Parent.Parent.Door.Transparency = 0 script.Parent.Parent.Door.CanCollide = true wait(3) script.Parent.BrickColor.new("Bright red") end
script.Parent.ClickDetector.MouseClick:connect(onClicked) --End of ButtonB.
--Layout: --Model (The door & all bricks in this script) --Model named "DoorFrame" (Has the frame -Non-important. --Frame1 --Frame2 --Frame3 --Frame4 --Frame5 ~ None of these are involved in script. --ButtonA --ClickDetector --Mesh --Script (For ButtonA) --ButtonB --Mesh --ClickDetector --Script (For ButtonB) --Door (Main part; nothing inside but a BlockMesh.)
-NCISrox |
|
|
| Report Abuse |
|
|
imike218
|
  |
| Joined: 28 Nov 2010 |
| Total Posts: 350 |
|
|
| 24 Dec 2011 09:06 AM |
| everything looks fine to me, but thats just meh |
|
|
| Report Abuse |
|
|
| |
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 09:08 AM |
The door didn't work. -NCISrox |
|
|
| Report Abuse |
|
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 09:09 AM |
Thanks ranger, I will see if that works. -NCISrox |
|
|
| Report Abuse |
|
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
| |
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 12:14 PM |
Paul, tell me what I did wrong. I took it to SH, took them three hours to post something, and their only correction was changing one line; they changed this: script.Parent.BrickColor.new("New Yeller") to script.Parent.BrickColor = BrickColor.new("New Yeller")
--Script for ButtonA (Opening door)
function onClicked() script.Parent.BrickColor = BrickColor.new("New Yeller") script.Parent.Parent.Door.Transparency = 1 script.Parent.Parent.Door.CanCollide = false wait(3) script.Parent.BrickColor = BrickColor.new("Bright green") end script.Parent.ClickDetector.MouseClick:connect(onClicked)
--End of ButtonA.
--In a different brick. ~ Script for ButtonB (Closing door)
function onClicked() script.Parent.BrickColor = BrickColor.new("New Yeller") script.Parent.Parent.Door.Transparency = 0 script.Parent.Parent.Door.CanCollide = true wait(3) script.Parent.BrickColor = BrickColor.new("Bright red") end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--End of ButtonB.
--Layout: --Model (The door & all bricks in this script) --Model named "DoorFrame" (Has the frame -Non-important. --Frame1 --Frame2 --Frame3 --Frame4 --Frame5 ~ None of these are involved in script. --ButtonA --ClickDetector --Mesh --Script (For ButtonA) --ButtonB --Mesh --ClickDetector --Script (For ButtonB) --Door (Main part; nothing inside but a BlockMesh.) -NCISrox |
|
|
| Report Abuse |
|
|
NCISrox
|
  |
| Joined: 04 Jun 2010 |
| Total Posts: 5184 |
|
|
| 24 Dec 2011 12:15 PM |
Whoos. wrong thread. *Takes ejector seat back to BH* -NCISrox |
|
|
| Report Abuse |
|
|