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: bad argument #1 to '?' (CFrame expected, got table)

Previous Thread :: Next Thread 
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 03:42 PM
wait(.5)
local w1 = Instance.new("Weld")
w1.Parent = script.Parent:FindFirstChild("Left Arm")
w1.Part0 = w1.Parent
w1.Part1 = script.Parent.Torso
w1.C1 = CFrame * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
wait(5)
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Apr 2012 03:45 PM
> w1.C1 = CFrame * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)

CFrame itself is a table, but the C1 property's value must be a CFrame value. I'm not sure whether you want it to rotate from the position 0, 1, 0, or from the CFrame it's already it, so if you want the former, do:

w1.C1 = CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)

If you want the latter, do:

w1.C1 = w1.CFrame * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Apr 2012 03:46 PM
I'm sorry, I made a mistake. If you want the latter, do:

w1.C1 = w1.C1 * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
30 Apr 2012 03:47 PM
CFrame * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)

What's the original CFrame for? You can plug that in, or just use this:

wait(.5)
local w1 = Instance.new("Weld")
w1.Parent = script.Parent:FindFirstChild("Left Arm")
w1.Part0 = w1.Parent
w1.Part1 = script.Parent.Torso
w1.C1 = CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
wait(5)
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Apr 2012 03:48 PM
@L2 - Do you want some jelly with that latetoast?
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 03:54 PM
Basicly i want the origanal place that it starts off to be first then it changes the angle from there but i cant get that working.
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
30 Apr 2012 03:55 PM
Try this:

wait(.5)
local w1 = Instance.new("Weld")
w1.Parent = script.Parent:FindFirstChild("Left Arm")
w1.Part0 = w1.Parent
w1.Part1 = script.Parent.Torso
w1.C1 = w1.C1 * CFrame.fromEulerAnglesXYZ(0,0,math.pi/4)
wait(5)
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Apr 2012 03:55 PM
All right, so you would do the latter. Change the whole thing to:

wait(.5)
local w1 = Instance.new("Weld")
w1.Parent = script.Parent:FindFirstChild("Left Arm")
w1.Part0 = w1.Parent
w1.Part1 = script.Parent.Torso
w1.C1 = w1.C1 * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
wait(5)
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 03:57 PM
may i ask what does latter mean?
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
30 Apr 2012 03:58 PM
Latter = The last one
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 04:03 PM
Its still not working?

wait(.5)
local w1 = Instance.new("Weld")
w1.Parent = script.Parent:FindFirstChild("Left Arm")
w1.Part0 = w1.Parent
w1.Part1 = script.Parent.Torso
w1.C1 = w1.C1 * CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0)
wait(5)
w1.C1 = w1.C1 * CFrame.new(0,1.5,0) * CFrame.fromEulerAnglesXYZ(0,1,0)
Report Abuse
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
30 Apr 2012 04:04 PM
Output?
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 04:10 PM
None but the arm is not moving :(
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
30 Apr 2012 04:11 PM
Use mine, and it should work.
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 04:22 PM
I got it to work but then i relised i need the modle to be ancored so i cant use Weld cfame. So i am just using cframe but now its not working?



Ra = script.Parent:FindFirstChild("Left Arm")
Ra.CFrame = Ra.CFrame.fromEulerAnglesXYZ(1, 0, 0) * CFrame.new(-1.5, 0, 0)
wait(5)
Ra.CFrame = Ra.CFrame.fromEulerAnglesXYZ(1.5, 0, 0) * CFrame.new(-1.5, -.5, -.5)
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 04:26 PM
fromEulerAnglesXYZ is not a valid member
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
30 Apr 2012 04:29 PM
CFrame.fromEulerAnglesXYZ instead of Ra.CFrame.


Ra = script.Parent:FindFirstChild("Left Arm")
Ra.CFrame = CFrame.fromEulerAnglesXYZ(1, 0, 0) * CFrame.new(-1.5, 0, 0)
wait(5)
Ra.CFrame = CFrame.fromEulerAnglesXYZ(1.5, 0, 0) * CFrame.new(-1.5, -.5, -.5)

Also, it's much easier to do this with Ra.CFrame * Instead of CFrame.new(), so use this:


Ra = script.Parent:FindFirstChild("Left Arm")
Ra.CFrame = CFrame.fromEulerAnglesXYZ(1, 0, 0) * Ra.CFrame
wait(5)
Ra.CFrame = CFrame.fromEulerAnglesXYZ(1.5, 0, 0) * Ra.CFrame
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 04:38 PM
How would i set the cframe start up if the players position was randomly spawned evrey time?
Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
30 Apr 2012 04:41 PM
So, you want to move the player to a random location, then use this script on the player?

Simple:
1) Teleport the player
2) Run the second version of this script (As it's reliant on the CFrame of the part, it doesn't matter where it is).
Report Abuse
BEART12 is not online. BEART12
Joined: 22 Oct 2008
Total Posts: 3190
30 Apr 2012 04:47 PM
Well how come my script sets 0,0,0 as the middle of the map and not were the arm is oragnaly placed on the modles body.


Ra = script.Parent:FindFirstChild("Left Arm")
Ra.CFrame = CFrame.fromEulerAnglesXYZ(190.5, 6.4, -36.5) * CFrame.new(0, 0, 0)
wait(5)
Ra.CFrame = CFrame.fromEulerAnglesXYZ(0, 0, 0) * CFrame.new(0,0,0)
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