Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Problems with rocket launcher?

Asked by 5 years ago
Edited 5 years ago

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)

0
you dont need to send the player, any remote's first argument is the player that sends it bhqpping 80 — 5y
0
the output say Hit is not a valid member of mouse, i think the problem is in the mouse? Realdava 2 — 5y

Answer this question