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 » Scripters
Home Search
 

Re: Open and Close Door Script

Previous Thread :: Next Thread 
iiSamGalaxy is not online. iiSamGalaxy
Joined: 28 Nov 2009
Total Posts: 80
04 Feb 2015 08:59 PM
How would you make a script to make a door open when you go near it, and close a few seconds after you walk past it?
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
04 Feb 2015 09:02 PM
part.Touched:connect(function(hit)
-- door
end)
Report Abuse
CUBES4LIFE is not online. CUBES4LIFE
Joined: 22 Jun 2009
Total Posts: 4956
05 Feb 2015 11:37 AM
enjoy one of the most basic scripts in existence..

local door = script.Parent.Parent.door
local sensor = script.Parent

function onTouch()
for i = 1, 70 do
door.CFrame = door.CFrame*CFrame.new(0.1, 0, 0)
wait()
end
wait(3)
for i = 1, 70 do
door.CFrame = door.CFrame*CFrame.new(-0.1, 0, 0)
wait()
end
end

sensor.Touched:connect(onTouch)
Report Abuse
xLink123 is not online. xLink123
Joined: 07 Aug 2014
Total Posts: 11158
05 Feb 2015 04:24 PM
Your script does the exact same thing except for you actually added the door opening / closing which I did not.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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