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

TFS 1.X+ Creature() method with custom monsters?

Booker

New Member
Joined
Apr 2, 2015
Messages
46
Reaction score
4
Hello, i'm using TFS 1.2 and i just cant get to return a monster instance using Creature() on a custom made monster passing in it's name as param.

This works:
Lua:
local monster = Creature("rabbit")
monster:getName()
>> Rabbit

This doesn't:
Lua:
local monster = Creature("myMonster")
monster:getName()
>> nil

I've registered the creature in monsters.xml, created it's LUA file(copied from another one) and i'ts spawning normally. I just don't understand why i can't instance it in my code to work with.

Appreciate your help!
 
Solution
then use a MonsterType
Lua:
local monsterType = MonsterType("myMonster")
print(monsterType:getName())
print(monsterType:getHealth())

here's some function documentation for you (attached as files)
then use a MonsterType
Lua:
local monsterType = MonsterType("myMonster")
print(monsterType:getName())
print(monsterType:getHealth())

here's some function documentation for you (attached as files)
 

Attachments

Solution
Back
Top