Emperoar
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 382 |
|
|
| 05 Feb 2013 12:51 PM |
As you may be wondering, many people have been messaging me on how to create a script for a sliding door. So, here it is. A fully functional sliding click door! This door was created by me in an attempt for my fort. I believe this is a very simple way for creating stereotypical designs for building.
I'd appreciate your feedback below. I hope this helps all you scripters.
~Emperoar~
------------------------------------------------------------------------------------------ local trigger = script.Parent local gate = script.Parent
moving = false open = false
function onClick() if open == false and moving == false then moving = true for i = 1, (gate.Size.Y * 12 + 6) do wait() gate.CFrame = gate.CFrame*CFrame.new(-0.1, 0, 0) end moving = false open = true wait(2) moving = true for i = 1, (gate.Size.Y * 12 + 6) do wait() gate.CFrame = gate.CFrame*CFrame.new(0.1, 0, 0) end moving = false open = false end end
script.Parent.ClickDetector.MouseClick:connect(onClick) ------------------------------------------------------------------------------------------ Place this inside your door along with inserting a click detector and you have a fully fledged and functional sliding door! :D |
|
|
| Report Abuse |
|
|
| |
|
|
| 04 Jun 2013 07:37 PM |
| my mom sais not to acept scripts frum strngers... |
|
|
| Report Abuse |
|
|
Slurpiee
|
  |
| Joined: 07 Sep 2011 |
| Total Posts: 6 |
|
| |
|
belspe200
|
  |
| Joined: 27 Oct 2010 |
| Total Posts: 157 |
|
|
| 22 Aug 2014 11:58 AM |
| How would i add a button instead of clicking the door? |
|
|
| Report Abuse |
|
|
|
| 22 Aug 2014 12:16 PM |
| What if i have many other bricks and scripts in the door and i want the push animation by clicking what do i do? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Oct 2014 07:23 AM |
| I don't know where the position is supposed to be for my door. It's shorter. |
|
|
| Report Abuse |
|
|
| |
|