roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,188
- Solutions
- 34
- Reaction score
- 200
i use tfs 1.2, have an item, like a shovel, that i use-with and after i click on the monster, but i get error
If i use isCreature() i dont get error, why i cant check if is monster?
I need to check if target is a monster..
Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if target and target:isMonster() then
print("is monster")
end
return true
end
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/test.lua:onUse
data/actions/scripts/test.lua:4: attempt to call method 'isMonster' (a nil value)
stack traceback:
[C]: in function 'isMonster'
data/actions/script/stest.lua:4: in function <data/actions/scripts/test.lua:3>
If i use isCreature() i dont get error, why i cant check if is monster?
I need to check if target is a monster..
Last edited: