Trying to make an FPS game, made a press R to reload script, however, once I reload, every time I shoot, it automatically reloads, even if I've only shot one bullet. Any suggestions on how I can fix it?
userInput.InputBegan:Connect(function(input, gameProcessed)
if not gameProcessed then
if input.UserInputType == Enum.UserInputType.Keyboard or Enum.UserInputType.Gamepad1 then
local keycode = input.KeyCode
if keycode == Enum.KeyCode.R or Enum.KeyCode.ButtonX then
reload_sound:Play()
reload_sound.Ended:Wait()
gun.Ammo.Value = 12
end
end
end
end)

1 comment
It has worked now, thank you for your help!