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
 

Re: Sliding doors activated by button?

Previous Thread :: Next Thread 
ColonelBacon is not online. ColonelBacon
Joined: 23 May 2011
Total Posts: 1870
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
ColonelBacon is not online. ColonelBacon
Joined: 23 May 2011
Total Posts: 1870
07 Aug 2011 08:27 PM
Bump?
Report Abuse
ColonelBacon is not online. ColonelBacon
Joined: 23 May 2011
Total Posts: 1870
07 Aug 2011 08:31 PM
Bump again...
Report Abuse
ColonelBacon is not online. ColonelBacon
Joined: 23 May 2011
Total Posts: 1870
07 Aug 2011 08:33 PM
Triple bump.
Report Abuse
ColonelBacon is not online. ColonelBacon
Joined: 23 May 2011
Total Posts: 1870
07 Aug 2011 08:37 PM
Quadruple bump.
Report Abuse
zxasqwcv3 is not online. 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
scripterzack is not online. scripterzack
Joined: 22 Jan 2011
Total Posts: 562
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 is not online. caca22
Joined: 31 May 2008
Total Posts: 96
07 Aug 2011 10:06 PM
Did you use Onclicked?
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