Aeronx
Intermediate OT User
- Joined
- Dec 17, 2015
- Messages
- 738
- Solutions
- 9
- Reaction score
- 123
Hello otlanders!
I've made a little script that every second uses the DB as in global event. So my question is, would it lag or even crash the server if there are 50+ players using this global event?
Is there a way to know the performance? a better way to make this?
Thank you for your time guys.
I've made a little script that every second uses the DB as in global event. So my question is, would it lag or even crash the server if there are 50+ players using this global event?
Is there a way to know the performance? a better way to make this?
Lua:
function onThink(interval)
local players = Game.getPlayers()
for _, player in pairs(players) do
if player:getStorageValue(55487) == 1 then
local maxhp = player:getMaxHealth()
local hp = player:getHealth()
local damage = math.floor(( hp * 100 ) / maxhp)
player:setStorageValue(7890, (100 - damage)/2)
end
end
return true
end
Thank you for your time guys.