• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

TFS 0.X Tfs 0.4 what is the better form to whrite?

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,210
Solutions
35
Reaction score
207
Hi guys, what is the better form (will get less time to run the script).

1)
Code:
if type == STATSCHANGE_HEALTHLOSS and value >= getCreatureHealth(cid) and getPlayerStorageValue(cid, 150) == 1 then
        function
     return true
     end


2)
Code:
if getPlayerStorageValue(cid, 150) == 1 then
     if type == STATSCHANGE_HEALTHLOSS and value >= getCreatureHealth(cid) then
        function
     end
end
return true
end
 
I think it would be storage verification first, I read once that they are stored on memory. If you check health loss first, it will "run" everytime some creature recieves damage before breaking in the next if.
 
Back
Top