• 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!

Add stats/regeneration if player has item in backpack?

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hey, it's possible to add regeneration hp / mp or X skill, to player if he has item in backpack, not equipped in inventory?
 
Solution
I thinking about contabo vps, for first edition (something like beta edition)
They have spec:
6 vCPU Cores
16 GB RAM
100 GB NVMeor 400 GB SSD (first option)
2 Snapshots
32 TB TrafficUnlimited Incoming
Note: "Recommended for test server, limited SSD write IOPS [1k per second] will make it lag with high number of players"
EDIT: I've tested 400 GB SSD version, maybe 100 GB NVMe has no limits or much higher limit.

Ok, but when i check "if player has item in backpack", hmm in every 1 min, it can laging server? if i got more than ~100 players
I think you can run it every 10 seconds and add regen/stats as...
You make a loop to check if ur backpack contains the item then add the regeneration etc.

Yea, but how to check is in real time? I think it possible to check it in login, but how if i check item after player login in creaturescript, i think he can give item to other player to get same bonus.
 
it will depend on your machine stats, but probably, not going to lag.

I thinking about contabo vps, for first edition (something like beta edition)
They have spec:
6 vCPU Cores
16 GB RAM
100 GB NVMeor 400 GB SSD (first option)
2 Snapshots
32 TB TrafficUnlimited Incoming
 
I thinking about contabo vps, for first edition (something like beta edition)
They have spec:
6 vCPU Cores
16 GB RAM
100 GB NVMeor 400 GB SSD (first option)
2 Snapshots
32 TB TrafficUnlimited Incoming
Note: "Recommended for test server, limited SSD write IOPS [1k per second] will make it lag with high number of players"
EDIT: I've tested 400 GB SSD version, maybe 100 GB NVMe has no limits or much higher limit.

Ok, but when i check "if player has item in backpack", hmm in every 1 min, it can laging server? if i got more than ~100 players
I think you can run it every 10 seconds and add regen/stats as Condition with custom subId (to make it easy to remove it by subId).
From some server experience: running 'search for item' 97 times per second for every player (200 online) is not at problem at server start, but when players collect more items, it may consume 100% CPU.
So problem is not only how often you will run that onThink script, but also how many different items will give boost = how many times you will run player:getItemCount(xxx)
 
Solution
I think you can run it every 10 seconds and add regen/stats as Condition with custom subId (to make it easy to remove it by subId).
From some server experience: running 'search for item' 97 times per second for every player (200 online) is not at problem at server start, but when players collect more items, it may consume 100% CPU.
So problem is not only how often you will run that onThink script, but also how many different items will give boost = how many times you will run player:getItemCount(xxx)

I thinking about two items, one for ms/ed and one for rp/ek, so i think in today population on servers for 8.6 client, its no problem, because i dont dream about more than 100 players in this time.
 
Back
Top