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

Lua how to make script which check player level?

gritness

Member
Joined
May 26, 2021
Messages
33
Reaction score
6
Hey,
Im looking for functions, which check player level, need to set storage if player gain 25lvl. Someone can help me ? :)
 
Solution
S
When player reach level 25 (its for update questlog for claim reward on 25lvl)
TFS 1.3
Lua:
- we need a storage to stop doing the same script each time player advance in level
local storage = 50323
if player:getLevel() >= 25 and player:getStorageValue(storage) <= 0 then
player:setStorageValue(50323, 1)
--You can add here what-ever you need even your other storage for quest ending
end
Hey,
Im looking for functions, which check player level, need to set storage if player gain 25lvl. Someone can help me ? :)

When player reach level 25 or everytime a player advance 25levels? Eg 25, 50, 75, 100 etc.

And... TFS1.3 or what you using?
 
what do you mean with gain 25 levels? and do you mean every 25 levels set storage? its too simple player:getLevel(), player:setStorageValue(Key, Value)

 
When player reach level 25 (its for update questlog for claim reward on 25lvl)
TFS 1.3
Lua:
- we need a storage to stop doing the same script each time player advance in level
local storage = 50323
if player:getLevel() >= 25 and player:getStorageValue(storage) <= 0 then
player:setStorageValue(50323, 1)
--You can add here what-ever you need even your other storage for quest ending
end
 
Solution
Lua:
- we need a storage to stop doing the same script each time player advance in level
local storage = 50323
if player:getLevel() >= 25 and player:getStorageValue(storage) <= 0 then
player:setStorageValue(50323, 1)
--You can add here what-ever you need even your other storage for quest ending
end
Thanks a lot. But i have 1 more question to it. where i have to put this script actions/events? (need to check players level everytime to 25lvl)
Post automatically merged:

or easier check player level on level up (but how :D ?)
 
Last edited:
Creaturescripts, function onAdvance(player, skill, oldLevel, newLevel)
Thanks, that should be enough. You are awesome
Post automatically merged:

Got 1 more problem ( I think the last one in this thema )

I did script which work perfectly, but still have problem with run script automatically.
Now idk whats type of event and name i have to write in creaturescripts.xml

<event type="" name="" script ="new/questlog25update.lua" />
 
Last edited:
Back
Top