i try to make a gunsound and its work but it dont have any cooldown so its sound bit weird thats the main problem another problem is i dont know how to add ammo limit like it can shoot infinity bullet
please help me:( also feel free if you want to teach me the ammunition problem you can help me by giving script that help or give me to devforum with solved problem
#cooldown in sound please:)
1 messages · Page 1 of 1 (latest)
add a debounce
if you want the sound to play without it cutting you can use SoundService playlocalsound
can you show me some script? or example I'm new in roblox studio
local db = false
local function something()
if not db then
db = true
-- do stuff
task.wait(5)
db = false
end
Add a variable: Ammo = 20 — u got 20 bullets
Before doing the gun sound, make an if statement
if ammo > 0 then
ammo-=1 — remove 1 ammo
gun_sound:Play()
end