Hello!
I'm trying to make a working !promotion talkaction script.
But i am so freakin bad at scripting, although i tried.
I'm not getting any errors in the console, it just takes money and says "You are already promoted!"
script
I'm trying to make a working !promotion talkaction script.
But i am so freakin bad at scripting, although i tried.
I'm not getting any errors in the console, it just takes money and says "You are already promoted!"
script
Code:
local cost = 20000
local level = 20
function onSay(cid, words, param, channel)
if getPromotedVocation(5,6,7,8) then
return doPlayerSendCancel(cid, 'You are already promoted.')
end
if getPlayerLevel(cid) < level then
return doPlayerSendCancel(cid, 'You must be at least level 20 in order to be promoted.')
end
if doPlayerRemoveMoney(cid, cost) then
vocation:getPromotion()
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have just been promoted')
doSendMagicEffect(getThingPos(cid), math.random(28,30))
doPlayerSave(cid)
else
return doPlayerSendCancel(cid, 'You must need '..cost..' gps in order to be promoted.')
end
return true
end