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