Closed IsacViana closed 11 months ago
In Lua 5.4, integer numbers are differentiated from float numbers, so if you don't round the number before passing it to the storage method then you will get a warning.
Isn't there a way to do 0.8s, 1.6s, and so on? @MillhioreBT
Isn't there a way to do 0.8s, 1.6s, and so on? @MillhioreBT
function Player.setExhaustion(self, key, milliseconds)
return self:setStorageValue(key, os.mtime() + milliseconds)
end
function Player.getExhaustion(self, key)
local milliseconds = self:getStorageValue(key)
if not milliseconds then return 0 end
return math.max(0, os.mtime() - milliseconds)
end
function Player.hasExhaustion(self, key) return self:getExhaustion(key) > 0 end
you must use milliseconds directly.
I'm having problems with Exhaustor in Scripts I want to set time to use x item or use x command and I can't because the base doesn't pull the os.time or something similar.
When I put 1 it works fine, but when I put 0.x or 1.x it doesn't work.