Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Vector3 expected, got CFrame?

The lines of code below, gives me this output:

Players.Player1.PlayerGui.LocalScript:25: bad argument #1 to 'new' (Vector3 expected, got CFrame)

		local a = new()
		local b = new()
		local c = new()
		a.Name = "Name"
		b.Name = "Usage"
		c.Name = "Desc"
		b.Rotation = Vector3.new(Char.Torso.Rotation.X, Char.Torso.Rotation.Y+90, Char.Torso.Rotation.Z)
		b.CFrame = CFrame.new(Char.Torso.CFrame*CFrame.new(0,0,-4.6)) --Line 25

Can anyone please help, and also explain why this is happening?

1 answer

✓ Accepted answer

The problem is that you are trying to construct a CFrame from another CFrame, which doesn't work. To fix this, just remove the call to CFrame.new:

local a = new()
local b = new()
local c = new()
a.Name = "Name"
b.Name = "Usage"
c.Name = "Desc"
b.Rotation = Vector3.new(Char.Torso.Rotation.X, Char.Torso.Rotation.Y+90, Char.Torso.Rotation.Z)
b.CFrame = Char.Torso.CFrame*CFrame.new(0,0,-4.6)

This discussion is preserved as it was. New answers, comments, and votes are closed.