I am trying to create a cool down for my walki-talki, I use a global variable to hold a cooldown value, but for some reason it is not working.
It keeps saying cooldown is enabled but cooldown is set to false
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Settings script:
_G.cooldown = 5 --Change this to the walki-talki cooldown
_G.onCooldown = false --Don't touch this or the Walki-Talkies will break
Main script:
script.Parent.MouseButton1Click:Connect(function()
if _G.cooldown == false then
wait()
_G.cooldown = true
script.Parent.Parent.Parent.Parent.Phone.Click:Play()
game.ReplicatedStorage.Remotes.WalkiTalki:FireAllClients("Breakfast")
wait(5)
_G.cooldown = false
else
print('Cooldown is enabled!')
end
end)
Any idea of what the problem is??