Greetings,
I am hoping someone could give me a quick revision in this script.
Currently, I have it set so it checks if you have more than 50,000 gold and has a success in the random, it would summon a boss.
But if either one fails, it sends this message "You either don't have enough money or Robin Hood did not come visit at this time!".
What I'm hoping someone could do is separate them, for example, if you don't have enough gold, it would say
"You do not have enough gold" and if your luck doesn't succeed, it would say "Robin Hood did not come visit this time".
Hope someone understands.
Here is the WORKING script for both at the same time:
REP++ to the one who has the working script
thanks,
Lostboy
I am hoping someone could give me a quick revision in this script.
Currently, I have it set so it checks if you have more than 50,000 gold and has a success in the random, it would summon a boss.
But if either one fails, it sends this message "You either don't have enough money or Robin Hood did not come visit at this time!".
What I'm hoping someone could do is separate them, for example, if you don't have enough gold, it would say
"You do not have enough gold" and if your luck doesn't succeed, it would say "Robin Hood did not come visit this time".
Hope someone understands.
Here is the WORKING script for both at the same time:
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
monster_pos = {x=842, y=1048, z=10}
money = getPlayerMoney(cid)
success = math.random(1, 7)
if item.itemid == 1945 and money >= 50000 and success == 1 then
doPlayerRemoveMoney(cid, 50000)
doTransformItem(item.uid, 1946)
addEvent(summonMonster, 3 * 1000)
doBroadcastMessage("Robin Hood, the prince of thieves has come to the town to steal gold. End him! End him for once and for all!", 22)
elseif item.itemid == 1946 then
doTransformItem(item.uid, 1945)
else
doCreatureSay(cid, "You either don't have enough money or Robin Hood did not come visit at this time!", TALKTYPE_ORANGE_1)
doPlayerRemoveMoney(cid, 50000)
end
return TRUE
end
function summonMonster()
doSummonCreature('Robin Hood', monster_pos)
doSendMagicEffect(monster_pos, 10)
end
REP++ to the one who has the working script
thanks,
Lostboy