• 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+ Passive group of monsters

BugaS

Donżuan
Joined
Mar 12, 2009
Messages
1,219
Reaction score
9
Location
NYC
Hello guys!

I saw passive monster script on otland and it's just cool, but is it possible to make something like that:

There is a group of 3 trolls (they are passive), if you attack 1 troll, all of them (3) will attack you. Is it possible?
 
Solution
Not sure, but have you tried using addFriend(creature) ?
Lua:
local monster = Monster(...)
monster:addFriend(some_userdata)

To add players as "friends" to the monsters when they get into screen/range. And then remove friend if they are getting attacked by the player.

Edit (further elaboration):
You can try this by creating a creatureevent, onThink, and attach it to the monsters in question. The onThink script should be able to get the target of the monster, or check for nearby players, see if they are hostile, if not, add them as a friend.
Not sure, but have you tried using addFriend(creature) ?
Lua:
local monster = Monster(...)
monster:addFriend(some_userdata)

To add players as "friends" to the monsters when they get into screen/range. And then remove friend if they are getting attacked by the player.

Edit (further elaboration):
You can try this by creating a creatureevent, onThink, and attach it to the monsters in question. The onThink script should be able to get the target of the monster, or check for nearby players, see if they are hostile, if not, add them as a friend.
 
Last edited:
Solution
Back
Top