Im making an ak47 for my game and im trying to make it so you can hold down instead of just spam clicking, the code doesnt work but i dont get any errors. this is the code
local mousedown = false
local uis = game:GetService("UserInputService")
script.Parent.Equipped:Connect(function(mouse)
uis.InputBegan:Connect(function(Input)
if Input == Enum.UserInputType.MouseButton1 then
mousedown = true
end
uis.InputEnded:Connect(function(Input)
mousedown = false
end)
end)
while mousedown do
wait(0.5)
game.ReplicatedStorage.GunEvent2:FireServer(script.Parent.Barrel.Flash.Position, mouse.Hit.Position)
end
end)

1 comment
if theres no errors that means the script is doing what it is told im not sure bit i belive this is a bug