• 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 getting "attempt to index a nil value" but its a valid value tfs 1.2

Zombiegod

Active Member
Joined
Oct 22, 2009
Messages
198
Solutions
1
Reaction score
25
so i am trying to add this script CreatureEvent - [TFS 1.1] Ultimate item stat system (elements, skills, exp, loot and more) (https://otland.net/threads/tfs-1-1-ultimate-item-stat-system-elements-skills-exp-loot-and-more.229771/)

to my server, i followed the thread and did all the recommended fixes, however i am getting this error with every attack i do
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/stats.lua:onHealthChange
data/lib/core/stats.lua:1715: attempt to index a nil value
stack traceback:
        [C]: in function '__index'
        data/lib/core/stats.lua:1715: in function <data/lib/core/stats.lua:1622>

Which references this part of the code function stat_onHealthChange(creature, attacker, primaryDamage, primaryType, sec - Pastebin.com (https://pastebin.com/bMxF7Nvx)

I dont know if i did something wrong, if i have a incompatibility or what. I know onHealthChange works i have another script that uses it, and disabling it changed nothing.

any help would be appreciated!
 
Last edited:
Start with TFS version and which line is causing error.
i apologize about forgetting the tfs version i was tired last night as for the line its points to this line

Lua:
local race = MonsterType(creature:getName()):getRace()
 

Similar threads

Back
Top