Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Solved] When vector3 expected, I put vector3 but then expects cframe?

Asked by 3 years ago
Edited by Leamir 3 years ago

This question has been solved by the original poster.

invalid argument #1 to 'new' (Vector3 expected, got CFrame)

The code makes a new part point towards a part but changes cframe, the problem is that it expects a vector3 for the first argument and when I put in a vector 3 it expects a cframe? Can someone help me on what I'm doing wrong?

local rocket = Instance.new("Part", workspace)
rocket.Anchored = true
rocket.Size = Vector3.new(1,1,4)
rocket.CFrame = CFrame.new(HRP.CFrame * CFrame.new(0,0,-2.5)) -- gives error
rocket.CFrame = CFrame.new(rocket.Position, AOE.Explosion.PrimaryPart.Position)

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Sorry, nothing wrong with this... It just didn't want CFrame.new!

Ad

Answer this question