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

I have a error any help please? invalid argument #1 to 'new' (Vector3 expected, got Boolean) [closed]

Asked by 2 years ago

Sorry for the repost last time nobody responded and people usually look at the newest Questions

game.ReplicatedStorage.EventBeam.OnServerEvent:Connect(function(player1)
    local beam = game.ReplicatedStorage.PowerParts.Beam:Clone()
    beam.Parent = game.Workspace
    local player = game.Workspace:FindFirstChild(player1.Name)
    beam:SetPrimaryPartCFrame(CFrame.new(beam.PrimaryPart.Position == (player.UpperTorso.Position + (player.LowerTorso.CFrame.lookVector*10))))
    game.Workspace.sounds.BeamFire:Play()
end)
0
check line 5. also, check that powerparts is in replicatedstorage. JesseSong 3916 — 2y
0
tell me if there's still an error JesseSong 3916 — 2y
0
check that your capitalisation is correct JesseSong 3916 — 2y
0
Still get it:[ robot7866 36 — 2y

Marked as Duplicate by JesseSong

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

2 answers

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

It looks like you're trying to change a value inside a CFrame, CFrames are a bunch of numbers defining the position, rotation, etc. Therefore you can't change a position inside a CFrame. I can't really see the logic behind what you're trying to set a CFrame to, therefore I can only give this explanation.

Developer article about CFrame

Ad
Log in to vote
0
Answered by 2 years ago

You used == which means its comparing

beam.PrimaryPart.Position

to

(player.UpperTorso.Position + (player.LowerTorso.CFrame.lookVector*10)

Secondly, you don't set a PrimaryPart's Position inside SetPrimaryPartCFrame(), this is what line 5 should look like, let me know if it works.

beam:SetPrimaryPartCFrame(CFrame.new(player.UpperTorso.Position + player.LowerTorso.CFrame.LookVector * 10))