QuickLearner
New Member
- Joined
- Mar 20, 2018
- Messages
- 21
- Reaction score
- 2
Hi, I need some ideas how to approach monster in the arena.
I have three same arenas to not block players.
So if one player enter arena he is teleported to one arena and globalStorage is set to 1. If another players wants to also enter arena he is teleported to the same looking arena but with different globalStorage value.
I am spawning monsters on enter the arena.
But now I want to somehow get a hook on the monsters so when player kill arena monster I can update player storage so it will say that you killed 1/6 arena monsters. When player leave the arena the monster ( only for the players arena, not all monsters from all arenas ) must dissapear.
I can not find the good approach to get the hook on the monsters for arena.
I tried to do something like that :
But it doesnt work.
The only thing that came to my mind that may have chance to work is to name the monsters different
ArenaMonster One
ArenaMonster Two
ArenaMonster Three
But that is stupid.
I just need to have the chance to somehow count killed monster and destroy monsters if player dies or leaves arena but I cannot find the good way to get a "hook" on the monsters.
Can somebody help me with this?
I have three same arenas to not block players.
So if one player enter arena he is teleported to one arena and globalStorage is set to 1. If another players wants to also enter arena he is teleported to the same looking arena but with different globalStorage value.
I am spawning monsters on enter the arena.
But now I want to somehow get a hook on the monsters so when player kill arena monster I can update player storage so it will say that you killed 1/6 arena monsters. When player leave the arena the monster ( only for the players arena, not all monsters from all arenas ) must dissapear.
I can not find the good approach to get the hook on the monsters for arena.
I tried to do something like that :
LUA:
local function initMonsters(monsterName, positions)
for _, pos in pairs(positions) do
local monster = Game.createMonster(monsterName, pos)
if monster then
monster:setStorageValue(9999, 1)
end
end
end
But it doesnt work.
The only thing that came to my mind that may have chance to work is to name the monsters different
ArenaMonster One
ArenaMonster Two
ArenaMonster Three
But that is stupid.
I just need to have the chance to somehow count killed monster and destroy monsters if player dies or leaves arena but I cannot find the good way to get a "hook" on the monsters.
Can somebody help me with this?