So I've made a framework for my game that I've been updating recently in order to accommodate more mechanics such rest animations, shooting animations, etc. What I'm trying to figure out is how to make it so when a player fires a shot they have to wait a certain amount of time in order to fire again. I'm relatively new to scripting.
Code used:
--//Shooting Animation Segment
script.Parent.Activated:Connect(function(onMouseClick)
local shooting = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Shoot)
local sound = game.StarterPack.Pistol.Sound
sound:Play()
shooting:Play()
wait(1)
end)
(Sound does not play for other players, only for the player using the tool, but that's a bit unrelated.)
If somebody could tell me my error or give me tips on how to fix it I'd greatly appreciate it.

2 comments
Thanks alot! This is going to help in the framework.
Glad to help :)