Skip to content
User Avatar
#3988
Auto-translated
Azgalor
green belly, the game doesn't know what a heroname is, to which it should add +1 attack. Here's a working version + I added a function for a negative response (because in your case, as I see, there should also be a function for a negative response):
function arena1F(hero)
arena1Fhero = hero
gold = GetPlayerResource(1, 6)
if gold >= 2000 then
QuestionBox ("/Maps/Multiplayer/arena/napadenie1.txt", "yes", "no")
else MessageBox("/Maps/Multiplayer/arena/napadenie1nexvatka.txt")
end
end

function yes()
SetPlayerResource(1, 6, gold-2000)
ChangeHeroStat(arena1Fhero, STAT_ATTACK, 1)
end

function no() --this is just an example of what will be called if you press No. The code can be changed to suit your needs, or the function call can be completely removed when refusing, by replacing "no" with nil in QuestionBox
SetPlayerResource(1, 6, gold-2000)
ChangeHeroStat(arena1Fhero, STAT_LUCK, 1)
end

Trigger(OBJECT_TOUCH_TRIGGER, "arena1", "arena1F")
Thank you, it worked)