script one
script.Parent.Shoot.OnServerEvent:Connect(function(player,LookAt) local FlukyGun = player.Character:FindFirstChild("[place holder]") if FlukyGun == nil then return end local cframe = FlukyGun.Barrel.CFrame local bullet = game.ReplicatedStorage.[place holder]:Clone() bullet.Parent = script.Parent bullet.CFrame = cframe bullet.Parent = script.Parent bullet.CFrame = cframe bullet.Velocity = LookAt*360 game.Debris:AddItem(bullet,3) end)
script two
script.Parent.Shoot.OnServerEvent:Connect(function(player,LookAt) local FlukyGun = player.Backpack:FindFirstChild("[place holder]") or player.Character:FindFirstChild("[place holder]") local cframe = FlukyGun.Barrel.CFrame local bullet = game.ReplicatedStorage.[place holder]:Clone() bullet.Parent = script.Parent bullet.CFrame = cframe bullet.Velocity = LookAt*360 local fly = Instance.new("BodyForce",bullet) fly.Force = Vector3.new(0,bullet:GetMass()*180,0) game.Debris:AddItem(bullet,10) wait(2) bullet:remove() end)
i may just be dumb but i dont know how to add a cool down lol
What you can do is add a debounce. Example:
local debounce = false if debounce == false then print("Debounce is false, continue") -- Code else print("Debounce is true, do not continue") end