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
 

CFrame door

Previous Thread :: Next Thread 
squibs47 is not online. squibs47
Joined: 14 Feb 2010
Total Posts: 339
20 Jan 2011 05:45 AM
Ok -.- Got frustrated with this. I made a model, named two of the parts Door1 and Door2, put ClickDetectors in BOTH and had the same scripts in both. But it won't work -.- Here's the script:

function onClicked()
for i - 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
wait(4)
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
end

script.Parent.ClickDetector.MouseClick(onClicked)
Report Abuse
ChuckNorrisWillFindU is not online. ChuckNorrisWillFindU
Joined: 17 Jan 2011
Total Posts: 22
20 Jan 2011 05:46 AM
I'm coming.
Report Abuse
squibs47 is not online. squibs47
Joined: 14 Feb 2010
Total Posts: 339
20 Jan 2011 05:47 AM
Wait, thi is the script. (Fixed a few spelling errors.) Still won't work.

function onClicked()
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
wait(4)
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
end

script.Parent.ClickDetector.MouseClick(onClicked)
Report Abuse
lasassin is not online. lasassin
Joined: 27 Feb 2009
Total Posts: 831
20 Jan 2011 06:30 AM
Give me the structure of the model and I might be able to help.
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
20 Jan 2011 06:59 AM
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Report Abuse
micolord is not online. micolord
Joined: 16 Mar 2009
Total Posts: 1242
20 Jan 2011 07:00 AM
function onClicked()
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
wait(4)
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

or...

script.Parent.ClickDetector.MouseClick:connect(
function()
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end
wait(4)
for i = 1,50 do
script.Parent.Parent.Door1.CFrame = script.Parent.Parent.Door1.CFrame * CFrame.new(0,0,0)
script.Parent.Parent.Door2.CFrame = script.Parent.Parent.Door2.CFrame * CFrame.new(0,0,0)
wait()
end end)
Report Abuse
squibs47 is not online. squibs47
Joined: 14 Feb 2010
Total Posts: 339
20 Jan 2011 01:38 PM
Alright, thanks
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