how do i add a cool down onto these scripts after i shoot em?
script one
01 | script.Parent.Shoot.OnServerEvent:Connect( function (player,LookAt) |
02 | local FlukyGun = player.Character:FindFirstChild( "[place holder]" ) |
03 | if FlukyGun = = nil then return end |
04 | local cframe = FlukyGun.Barrel.CFrame |
05 | local bullet = game.ReplicatedStorage. [ place holder ] :Clone() |
06 | bullet.Parent = script.Parent |
07 | bullet.CFrame = cframe |
09 | bullet.Parent = script.Parent |
10 | bullet.CFrame = cframe |
11 | bullet.Velocity = LookAt* 360 |
12 | game.Debris:AddItem(bullet, 3 ) |
script two
01 | script.Parent.Shoot.OnServerEvent:Connect( function (player,LookAt) |
02 | local FlukyGun = player.Backpack:FindFirstChild( "[place holder]" ) or player.Character:FindFirstChild( "[place holder]" ) |
03 | local cframe = FlukyGun.Barrel.CFrame |
04 | local bullet = game.ReplicatedStorage. [ place holder ] :Clone() |
05 | bullet.Parent = script.Parent |
06 | bullet.CFrame = cframe |
07 | bullet.Velocity = LookAt* 360 |
08 | local fly = Instance.new( "BodyForce" ,bullet) |
09 | fly.Force = Vector 3. new( 0 ,bullet:GetMass()* 180 , 0 ) |
10 | game.Debris:AddItem(bullet, 10 ) |
i may just be dumb but i dont know how to add a cool down lol