So i want a rocket launcher missile following player mouse

here is the server script:

script.Parent.RemoteEvent.OnServerEvent:Connect(function(player, Mouse)

local Missile = Instance.new("Part")

local Fire = Instance.new("Fire")

local Force = Instance.new("BodyForce")

Force.Parent = Missile

Force.Force = Vector3.new(Mouse.Hit.X,Mouse.Hit.Y,Mouse.Hit.Z)

Fire.Parent = Missile

Missile.Parent = workspace

Missile.CFrame = script.Parent.Handle.CFrame * CFrame.new(4,0,0)

Missile.CanCollide = false

Missile.Size = Vector3.new(6.25, 0.66, 0.64)

end)

and this is the local script:

local player = game.Players.LocalPlayer

local Mouse = player:GetMouse()

script.Parent.Activated:Connect(function()

script.Parent.RemoteEvent:FireServer(player, Mouse)

end)

2 comments

0

you dont need to send the player, any remote's first argument is the player that sends it

0

the output say Hit is not a valid member of mouse, i think the problem is in the mouse?