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: Cframe Moving thingy

Previous Thread :: Next Thread 
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 10:49 AM
Hello all.

I have this script which opens a door when clicked.

local cf = script.Parent.CFrame

function onClicked()
if script.IsOpened.Value == false and script.IsOpening.Value == false then
script.IsOpening.Value = true
for i = 1,16 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
wait(0.01)
end
script.IsOpening.Value = false
script.IsOpened.Value = true
elseif script.IsOpened.Value == true and script.IsOpening.Value == false then
script.IsOpening.Value = true
for i = 1,16 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0, -0.1, 0) * CFrame.new(0, 0, -0.18)
wait(0.01)
end
script.IsOpening.Value = false
script.IsOpened.Value = false
script.Parent.CFrame = cf
script.CloseSound:Play()
end
end

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


There are 2 problems.

1: I need it to open more then one part. (3 parts and 1 union including this)
2: It won't open all the way.

Can anyone help me fix the script. The door can be found here:

http://web.roblox.com/testing-item?id=184984625


Kind regards

AgentL3r
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 11:17 AM
bump eins
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 11:29 AM
bump zwei
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 11:38 AM
bump drei
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 12:13 PM
bump 4
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 01:17 PM
bump 5
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 02:10 PM
bump 6
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
01 Nov 2014 02:12 PM
1. Use another for loop to iterate through the parts to move 'em.
2. Adjust the amount of steps in your for loop.

1. Alternatively, GROUP all the parts of the door within the model, set a primary part, and move that with :SetPrimaryPartCFrame().
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
01 Nov 2014 03:48 PM
How do I make another forloop for the other parts?
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 04:11 AM
bump 7
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 04:55 AM
bump 8
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 05:40 AM
bump 9
Report Abuse
SkiIlage is not online. SkiIlage
Joined: 25 Nov 2011
Total Posts: 51
02 Nov 2014 05:43 AM
coroutine?

They allow you to create a function that doesn't pause until it's finished, it just runs while the rest of the script runs.
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 06:11 AM
^ Erm I don't think so
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 07:23 AM
bump 10
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 12:40 PM
bump 11
Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
02 Nov 2014 12:42 PM
bump zwolf

Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
02 Nov 2014 12:43 PM
bump dreizehn
Report Abuse
davisky2 is not online. davisky2
Joined: 04 Mar 2012
Total Posts: 4710
02 Nov 2014 12:43 PM
bump vierzehn

Should i continue?
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 01:12 PM
Nein.

Danke
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
02 Nov 2014 03:07 PM
bump 15
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
03 Nov 2014 10:21 AM
bump 16
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
03 Nov 2014 10:25 AM
You want the door to open with multiple parts? I have just such a door i made a while back, Let me see if i can fetch the script for you.
Report Abuse
ShadowOfCrimson is not online. ShadowOfCrimson
Joined: 14 Dec 2009
Total Posts: 2153
03 Nov 2014 10:32 AM
Long and painful was that process... I basically rotated and moved the main part of the door, and then used its cframe to offset and rotate the other pieces after. Its the hard way to go about it, but that was 4 years ago. Probably some better way to do it now, but thats what i got. my "Project" place has it in it, look at the script in the door, ill uncopylock it for you.
Report Abuse
AgentL3r is not online. AgentL3r
Joined: 14 Jan 2013
Total Posts: 1671
03 Nov 2014 11:44 AM
That didn't work. I editied the script around and lets say it didn't turn out right.


Bump 17
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