• 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 NPC System [TFS 1.2]

flaviiojr

Active Member
Joined
Jan 20, 2017
Messages
230
Solutions
13
Reaction score
39
What do I add in the script for npc to give 20 exp for each monster the player killed?
Thank you very much in advance!

TFS 1.2
Client 10.98
 
Last edited:
Solution
Lua:
local killedMonstersCountStorage = 77777
(make sure to set the variable to something not already used)

Keep track of killed monsters with creaturescripts death event then add exp in NPC like this:

Lua:
player:addExperience(20 * (player:getStorageValue(killedMonstersCountStorage) > 0 and player:getStorageValue(killedMonstersCountStorage) or 0))
Lua:
local killedMonstersCountStorage = 77777
(make sure to set the variable to something not already used)

Keep track of killed monsters with creaturescripts death event then add exp in NPC like this:

Lua:
player:addExperience(20 * (player:getStorageValue(killedMonstersCountStorage) > 0 and player:getStorageValue(killedMonstersCountStorage) or 0))
 
Solution
Lua:
local killedMonstersCountStorage = 77777
(make sure to set the variable to something not already used)

Keep track of killed monsters with creaturescripts death event then add exp in NPC like this:

Lua:
player:addExperience(20 * (player:getStorageValue(killedMonstersCountStorage) > 0 and player:getStorageValue(killedMonstersCountStorage) or 0))
thank very much! Its work... I Love You @Frija
 
Back
Top