|
| 07 Aug 2011 08:22 PM |
Ok, So I'm trying to make sliding doors for a base that I am making. I can't script to save my life, so I took some Free Modeled sliding doors and took the script out. This script is in both the button and the door:
Speed = 1 -- Speed at which the door rises. Higher = faster. Time = 3 -- Time between the door totally open and starting to close. Running = false for x,z in pairs(script.Parent.Parent:getChildren()) do if z.Name == "Button" then z.CD.MouseClick:connect(function () if Running == true then return end Running = true for i=1,script.Parent.Size.y/Speed*10+1 do script.Parent.CFrame = script.Parent.CFrame*CFrame.new(0,0.1*Speed,0) wait() end wait(Time) for i=1,script.Parent.Size.y/Speed*10+1 do script.Parent.CFrame = script.Parent.CFrame*CFrame.new(0,-0.1*Speed,0) wait() end Running = false end) end end
I took this script and put it into another brick, but when you press the button the button moves instead of the brick. I have no idea what I have to do to make this work so I leave it in the hands of the professionals! :D |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
zxasqwcv3
|
  |
| Joined: 09 Jan 2009 |
| Total Posts: 106 |
|
|
| 07 Aug 2011 09:38 PM |
| wouldnt it be easier to make the sliding doors open by walking near them |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2011 09:48 PM |
| Use the one in my model. Sorry its messy though ive been meaninbg to clean it out =/ |
|
|
| Report Abuse |
|
|
caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
| |
|