onewave1
Member
- Joined
- May 26, 2021
- Messages
- 90
- Reaction score
- 15
I need a gaffir when he has 50% of his life he creates an "ugly monster"
I have something like this but it work only with first monster
the point is that it does not draw again and count = false
TFS 1.3
Lua:
local uglyspawn = CreatureEvent("uglyspawn")
local count = true
local chance = math.random(0, 100)
function uglyspawn.onThink(creature)
local hp = (creature:getHealth()/creature:getMaxHealth())*100
print(count)
print(chance)
if chance < 33 then
if (hp < 50 and count) then
Game.createMonster("Ugly Monster", creature:getPosition())
count = false
end
end
end
uglyspawn:register()
the point is that it does not draw again and count = false
TFS 1.3