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)
✓ ANSWER ACCEPTED
I have this error any help please? invalid argument #1 to 'new' (Vector3 expected, got Boolean)
1 answer
✓ Accepted answer
right on line 5 (beam.PrimaryPart.Position == (player.UpperTorso.Position
signs are used to compare 2 different values, not to use values im taking it you wanted to add on the position? in that case its a simple fix
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)
you also dont need all of the brackets you put in as youre only doing addition and multiplication at the end
This discussion is preserved as it was. New answers, comments, and votes are closed.
