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: Using an object instead of numbers

Previous Thread :: Next Thread 
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:14 PM
I have this:
--
direction=script.Value.Value
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(direction)
--
The value has the angle I want, but it just gives me this error:
20:07:47.566 - Workspace.Part.Script:3: bad argument #3 to 'fromEulerAnglesXYZ' (number expected, got no value)

What am I doing wrong?
Report Abuse
ProfitMargin is not online. ProfitMargin
Joined: 01 Aug 2013
Total Posts: 285
26 Aug 2013 10:15 PM
Put it in a float? MAke sure there is something inside the variable?
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 10:20 PM
--What output say
direction=script.Value.Value
print(direction)
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0, 0, 0) * CFrame.fromEulerAnglesXYZ(direction)
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:20 PM
It's a vector3value, and it does have the numbers I want.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Aug 2013 10:21 PM
:fromEularAnglesXYZ
not .
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 10:21 PM
fromEulerAnglesXYZ() takes 3 numbers, not a Vector3 :L
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:22 PM
@Screw:
0.619343221, 0.357578009, 0.698964953
20:18:07.922 - Workspace.testbrick.Script:4: bad argument #3 to 'fromEulerAnglesXYZ' (number expected, got no value)
20:18:07.922 - Script 'Workspace.testbrick.Script', Line 4
20:18:07.922 - stack end
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 10:22 PM
It's actually '.' lulz xP
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Aug 2013 10:24 PM
Really? O_o
I always thought it was a method...
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:25 PM
I took it out of a working cframe door, so you're wrong.
But I'm still stuck. Would another kind of value work?
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:28 PM
Using
* CFrame.Angles(direction)
also didn't work.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Aug 2013 10:30 PM
Then it's not that part.

They should work as:

Angles(x, y, z [, etc])
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:33 PM
I don't know what you mean.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Aug 2013 10:34 PM
Part.CFrame = Part.CFrame * CFrame.Angles(math.pi, 0, 0)
Will rotate the part by the X position
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 10:35 PM
@cnt ikr

@op Like I said, you feed it 3 numbers, not a Vector3 Value. Just try this to avoid changing everything cause of this :x

direction=script.Value.Value
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(tostring(direction):match("([^,]+),([^,]+),([^,]+)"))

--or you could be bland and be like

CFrame.fromEulerAnglesXYZ(direction.x,direction.y,direction.z)
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:44 PM
Um.. What kind of value stores three numbers?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Aug 2013 10:45 PM
Vector3Value?
CFrameValue?
UDim2Value stores 4
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 10:47 PM
Color3 :D
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Aug 2013 10:49 PM
and a lot more c:
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:52 PM
Vector3 didn't work with EulerAnglesXYZ(direction.x,direction.y,direction.z)
CFrameValue isn't showing a "Value" property.
I don't even see a UDim2Value anywhere.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 10:55 PM
Script and output while trying "EulerAnglesXYZ(direction.x,direction.y,direction.z)"
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:56 PM
Same as before.
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
26 Aug 2013 10:57 PM
I have to go for tonight, I guess I'll bump this tomorrow.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
26 Aug 2013 11:00 PM
Just tested script and works. You prolly did something wrong...

direction=script.Value.Value
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(direction.x,direction.y,direction.z)
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