Here's my script I was trying to get it to only shoot when I hold it out but it continues to shoot anyways
local Part = game.ReplicatedStorage.Fireball local Tool = script.Parent local Players = game:GetService("Players") local Player = Players.LocalPlayer local Mouse = Player:GetMouse() script.Parent.Equipped:Connect(function() Mouse.Button1Up:Connect(function() local partclone = Part:Clone() local PlayerPos = Player.Character.HumanoidRootPart.Position partclone.CFrame = Tool.Handle.CFrame local Vel = Instance.new("BodyVelocity",partclone) Vel.P = Vector3.new(100000,100000,100000) Vel.Velocity = Mouse.Hit.LookVector * 100 partclone.Parent = game.Workspace end) end)
If you know a fix, send it please.
So I see one thing that's wrong with this. I don't do guns but I know it's supposed to shoot when the mouse it down not up. Just change line 7 to this.
Mouse.Button1Down
Also, before posting, look on the DevHub then DevForum before coming here. Also, look at this. It has some good information for what you're doing.