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 |
|
|
|
| 29 Oct 2012 09:52 PM |
>for i do 1, 90
should be
>for i = 1, 90 do |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 29 Oct 2012 09:58 PM |
^ Problem #4 is incorrect. He defined SD in his first line. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|