-
What do you want to achieve? Keep it simple and clear!
So i have a cooldown between player can get currency for click. And for security reasons i’m doing delay on server. And just realised i have delay of server in code, so i want to make it in a single script. As i understand i should do time ticker or should i calculate math like
os.clock() + cooldown
and save it to server table named like CD?
Here is some code with os.time:
local CooldownLevel = ValueFixer(PlayerManager.GetUpgrade(player, "PhotonUpgrades", "Cooldown", "CurrLevel"))
local CooldownTime = InfiniteMath.new(Formulas:UpgradeFormulas(player, "Cooldown", CooldownLevel))
if table.find(PhotonGainCD, player) then return end
local CD = os.clock() + CooldownTime
table.insert(PhotonGainCD, player)
table.insert(PhotonGainCD[player], CD)