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 Rotation

Previous Thread :: Next Thread 
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
29 Oct 2012 09:44 PM
SD = script.Parent.SiloDoor.Hinge

function epicness()
wait(5)
for i do 1,90
SD.CFrame = script.Parent.CFrame * CFrame.Angles(0, 0, i);
end

Output: Workspace.ICBM silo.MainBrick.Script:5: '=' or 'in' expected near 'do'

As you can see simple script... Just not sure whats wrong.

Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
29 Oct 2012 09:52 PM
>for i do 1, 90

should be

>for i = 1, 90 do
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
29 Oct 2012 09:57 PM
function epicness()
     wait(5)
     for i = 1, 90 do
          SD.CFrame = script.Parent.CFrame * CFrame.Angles(0, 0, math.rad(i));
     end
end

-- Problems --
1) Missing an 'end'
2) Incorrectly formatted 'for loop'
3) Using 90 degrees without turning them into the RBX standard of radians
4) Variable 'SD' is still undefined

Also remember that you need to call the function 'epicness' for it all to run.
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
29 Oct 2012 09:58 PM
^
Problem #4 is incorrect.
He defined SD in his first line.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
29 Oct 2012 10:08 PM
Okay... Nothing is happened, even when I added the SD after the function, no errors..

http://www.roblox.com/ICBM-Silo-Needs-scripting-help-item?id=96439052

Checked my Parenting, its all there. I just can't seem to find the problem, output is empty..

Wait... Error in my script..

function epicness()
SD = script.Parent.Parent.SiloDoor.Hinge

wait(.5)
for i = 1, 90 do
SD.CFrame = script.Parent.CFrame * CFrame.Angles(0, 0, math.rad(i));
end
end

its the 2nd SD part, over parenting it... what do I replace the "script.Parent.CFrame" with? or can I just do this?:

function epicness()
SD = script.Parent.Parent.SiloDoor.Hinge

wait(.5)
for i = 1, 90 do
SD.CFrame * CFrame.Angles(0, 0, math.rad(i));
end
end

well if I do that, I get this:

21:42:59 - Workspace.ICBM silo.MainBrick.Script:5: '=' or 'in' expected near 'do'
22:07:05 - Workspace.ICBM silo.MainBrick.Script:6: '=' expected near '*'
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
29 Oct 2012 10:16 PM
/\
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Oct 2012 12:17 PM
Help?
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
30 Oct 2012 12:25 PM
SD = script.Parent.SiloDoor.Hinge
function epicness()
wait(5)
for i = 1,90 do
SD.CFrame = script.Parent.CFrame * CFrame.Angles(0, 0, math.rad(i))
end
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
30 Oct 2012 12:26 PM
Correction.

The Hinge object does not have a CFrame, but it has as C0, and a C1.

SD = script.Parent.SiloDoor.Hinge
function epicness()
wait(5)
for i = 1,90 do
SD.C1 = script.Parent.CFrame * CFrame.Angles(0, 0, math.rad(i))
end
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Oct 2012 12:37 PM
Nothing...

Needed to add another end and parent to fix an output error...

SD = script.Parent.Parent.SiloDoor.Hinge
function epicness()
wait(5)
for i = 1,90 do
SD.C1 = script.Parent.CFrame * CFrame.Angles(0, 0, math.rad(i))
end
end

"The Hinge object does not have a CFrame, but it has as C0, and a C1."

If I add a Cframe Value to "Hinge" would I be able to use my last script?
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
30 Oct 2012 12:39 PM
Not really.

You see, C1, and C0 are CFrame values.
http://wiki.roblox.com/index.php/C0_(Property) --Base
http://wiki.roblox.com/index.php/C1_(Property) --Offset

Also, you never called the function! D:
That's why nothing is happening.

SD = script.Parent.Parent.SiloDoor.Hinge
function epicness()
wait(5)
for i = 1,90 do
SD.C1 = script.Parent.CFrame * CFrame.Angles(0, 0, math.rad(i))
end
end

epicness()
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
30 Oct 2012 12:40 PM
Tip:

C0 should be the CFrame of the part the "Hinge" is on. C1 should be the CFrame of the other part.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Oct 2012 01:33 PM
13:32:09 - C1 is not a valid member of Part
13:32:09 - Script "Workspace.ICBM silo.MainBrick.Script", Line 5 - global epicness
13:32:09 - Script "Workspace.ICBM silo.MainBrick.Script", Line 9
13:32:09 - stack end

I'm confused on how to make the part rotate now..
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
30 Oct 2012 01:36 PM
Try CFrame then. Maybe I was wrong abaout C0/C1. Wiki say's there's a C1/C0.
Report Abuse
GUESTHAXX is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
30 Oct 2012 01:53 PM
ok..

:T
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