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
 

Sliding Door *SCRIPT*

Previous Thread :: Next Thread 
Emperoar is not online. 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
DRULLSTRONG26 is not online. DRULLSTRONG26
Joined: 01 Sep 2011
Total Posts: 2091
04 Jun 2013 07:32 PM
k
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
04 Jun 2013 07:37 PM
my mom sais not to acept scripts frum strngers...
Report Abuse
Slurpiee is not online. Slurpiee
Joined: 07 Sep 2011
Total Posts: 6
20 Jul 2014 06:45 AM
Thanks man.
Report Abuse
belspe200 is not online. 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
NoobsAreTheWorld is not online. NoobsAreTheWorld
Joined: 04 Nov 2013
Total Posts: 2044
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
TheKorbloxAvenger is not online. TheKorbloxAvenger
Joined: 31 Oct 2012
Total Posts: 3
30 Aug 2014 04:14 PM
Works :D
Report Abuse
AssassianGeek214 is not online. AssassianGeek214
Joined: 31 Jan 2013
Total Posts: 1
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
rediceop123 is not online. rediceop123
Joined: 18 May 2013
Total Posts: 1
11 Nov 2014 11:29 AM
it dons't work for me
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