adrenyslopez
Member
- Joined
- Dec 22, 2015
- Messages
- 201
- Reaction score
- 15
everyone, I have a problem with this scripts, I am using it on a creature and it works 100% and I made another one only that with another creature and it does not work
i used otbr tfs 1.3
This is working
And this one doesn't work
i used otbr tfs 1.3
This is working
Lua:
local bossForms = {
['snake god essence'] = {
text = 'IT\'S NOT THAT EASY MORTALS! FEEL THE POWER OF THE GOD!',
newForm = 'snake thing'
},
['snake thing'] = {
text = 'NOOO! NOW YOU HERETICS WILL FACE MY GODLY WRATH!',
newForm = 'lizard abomination'
},
['lizard abomination'] = {
text = 'YOU ... WILL ... PAY WITH ETERNITY ... OF AGONY!',
newForm = 'mutated zalamon'
}
}
local zalamonKill = CreatureEvent("ZalamonKill")
function zalamonKill.onKill(player, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
if targetMonster:getName():lower() == 'mutated zalamon' then
Game.setStorageValue(Storage.WrathoftheEmperor.Mission11, -1)
return true
end
local name = targetMonster:getName():lower()
local bossConfig = bossForms[name]
if not bossConfig then
return true
end
local found = false
for k, v in ipairs(Game.getSpectators(targetMonster:getPosition())) do
if v:getName():lower() == bossConfig.newForm then
found = true
break
end
end
if not found then
Game.createMonster(bossConfig.newForm, targetMonster:getPosition(), false, true)
player:say(bossConfig.text, TALKTYPE_MONSTER_SAY)
end
return true
end
zalamonKill:register()
And this one doesn't work
Code:
local bossForms = {
['feroxa'] = {
text = 'Transform!',
newForms = 'feroxa weak'
},
['feroxa weak'] = {
text = 'Transform!',
newForms = 'feroxa human'
},
['feroxa human'] = {
text = 'Transform!',
newForms = 'feroxa wolf'
},
['feroxa wolf'] = {
text = 'Transform!',
newForms = 'Feroxa Ultimate'
}
}
local feroxaKill = CreatureEvent("FeroxaKill")
function feroxaKill.onKill(player, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
local name = targetMonster:getName():lower()
local bossConfig = bossForms[name]
if not bossConfig then
return true
end
local found = false
for k, v in ipairs(Game.getSpectators(targetMonster:getPosition())) do
if v:getName():lower() == bossConfig.newForms then
found = true
break
end
end
if not found then
Game.createMonster(bossConfig.newForms, targetMonster:getPosition(), false, true)
player:say(bossConfig.text, TALKTYPE_MONSTER_SAY)
end
return true
end
feroxaKill:register()