Hi, i was bored so i created this basic script.
Remove X cash and add X levels.
actions\scripts\buylevels.lua:
actions.xml:
Remember to change the config.
Rep++? Post here what you think about the script. Haters gonna hate :$
/R
Remove X cash and add X levels.
actions\scripts\buylevels.lua:
Lua:
local config = {
addLevels = 2,
costAmount = 15000,
maxLevel = 300,
}
local bought = {
boughtMessage = 'You just bought '.. config.addLevels ..' levels for '.. config.costAmount ..' gold coins.',
cancelMessage = 'You need '.. config.costAmount ..' gold coins to buy '.. config.addLevels.. ' levels.',
maxlevelMessage = 'You are too high level to use this.',
}
function onUse(cid, item, fromPosition, itemEx, toPosition) -- Rasmus75
if getPlayerLevel(cid) < config.maxLevel then
if(doPlayerRemoveMoney(cid, config.costAmount)) then
doPlayerAddLevel(cid, config.addLevels)
doPlayerSendTextMessage(cid, 27, bought.boughtMessage)
else
doPlayerSendTextMessage(cid, 27, bought.cancelMessage)
end
else
doPlayerSendTextMessage(cid, 27, bought.maxlevelMessage)
end
return true
end
XML:
<action actionid="41444" event="script" value="buylevels.lua"/>
Remember to change the config.
Rep++? Post here what you think about the script. Haters gonna hate :$
/R
Last edited: