|
| 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
|
  |
| Joined: 07 Aug 2014 |
| Total Posts: 11158 |
|
|
| 04 Feb 2015 09:02 PM |
part.Touched:connect(function(hit) -- door end) |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|