im trying to make a gun on filtering enabled on, the remote event is in replicatedstorage. here's the script:
script.Parent.Parent.Activated:connect(function() game.ReplicatedStorage.GunShootingEvent:FireServer() end)
then here's the script for the main content
game.ReplicatedStorage.GunShootingEvent.OnServerEvent:connect(function(player) part = Instance.new("Part",game.Workspace) mouse = player:GetMouse() game.Debris:AddItem(part, 2) part.Size = Vector3.new(0.2,0.2,3) part.Material = "Neon" part.TopSurface = "Smooth" part.BottomSurface = "Smooth" part.LeftSurface = "Smooth" part.RightSurface = "Smooth" part.BrickColor = BrickColor.new("New Yeller") part.CanCollide = false part.CFrame = player.Character.StarterPistol.Handle.CFrame part.CFrame = CFrame.new(part.Position, mouse.Hit.p) v = Instance.new("BodyVelocity",part) v.Velocity = part.CFrame.lookVector * 500 v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
end)
please I really need help on this, i put a variable stating the mouse, and I have no clue why it doesnt work.

4 comments
Wrap your code into a code block and cut out everything that isn't part of your problem so it's easier to read. Otherwise, there's a high chance that NO ONE will give you quality answers.
Also, your RemoteEvent for firing a gun should be placed inside of the actual tool instead of inside of ReplicatedStorage.
i did it, but it still wouldnt work.
You cannot get the mouse from the server, and the parent argument to Instance.new is deprecated