#I need help with my script an error keeps popping

1 messages · Page 1 of 1 (latest)

fallow nest
#

local RS = game:GetService("ReplicatedStorage")

RS.ThrowRemote.OnServerEvent:Connect(function(plr, direction, mouseaim)
print("the server has been changed")
local hrp = plr.Character.HumanoidRootPart
local beam3 = RS.Wave:Clone()
local infNum = math.huge
beam3.PrimaryPart.CFrame = CFrame.new((hrp.CFrame * CFrame.new(0, 2, 0)).Position, mouseaim)

beam3.Parent = workspace


local BV3 = Instance.new("BodyVelocity", beam3.PrimaryPart)
BV3.MaxForce = Vector3.new(
    infNum,
    infNum,
    infNum
)
BV3.Velocity = CFrame.new(hrp.Position, mouseaim).LookVector * 41

local part5 = beam3.m1
local part6 = beam3.m2

end)

this is the code

#

This is the line where the error keeps going

#

beam3.PrimaryPart.CFrame = CFrame.new((hrp.CFrame * CFrame.new(0, 2, 0)).Position, mouseaim)

#

the error is:

#

ServerScriptService.ServerSide:9: invalid argument #2 to 'new' (Vector3 expected, got nil)

#

I need help

dusty stag
#

mouseaim is nil

terse frigate
#

wait

fallow nest
#

Its solved now

#

dw

terse frigate
#

oh alr then

#

and next time please embed it