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?
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)