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

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

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)

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.