This is some useful functions
<-- function onSay(cid, words, param) -->
<-- function onUse(cid, item, frompos, item2, topos) -->
<-- function onStepIn(cid, item, position, fromPosition) -->
<-- function onCastSpell(cid, var) -->
<-- Let's start off with creating a command to buy a rune -->
<-- Let's make a reward by clicking a switch -->
<-- Let's make a EXP tile -- >
<-- function onSay(cid, words, param) -->
<-- function onUse(cid, item, frompos, item2, topos) -->
<-- function onStepIn(cid, item, position, fromPosition) -->
<-- function onCastSpell(cid, var) -->
<-- Let's start off with creating a command to buy a rune -->
Code:
function onSay(cid, words, param)
local cost = 10000 <-- enter the number of gps the rune should cost -->
local charges = 10000 <-- write on how many charges you should get -->
if doPlayerRemoveMoney(cid, cost) == TRUE then
doPlayerAddItem(cid, item id, charges)
doPlayerSendTextMessage,cid,22,"You bought a rune"
else
doPlayerSendTextMessage(cid,22,"Not Enough Money"
end
return TRUE
end
<-- Let's make a reward by clicking a switch -->
Code:
function onUse(cid, item, frompos, item2, topos)
if doPlayerAddItem(cid, 2150, 1) == TRUE then
doPlayerSendTextMessage(cid,22,"You earned a reward"
end
return TRUE
end
<-- Let's make a EXP tile -- >
Code:
function onStepIn(cid, item, position, fromPosition)
if doPlayerAddExp(cid, 22) TRUE then <-- You can change the EXP amount -->
doPlayerSendTextMessage(cid,22,"You walked on a tile, 22 exp earned")
doSendMagicEffect(getPlayerPosition(cid), 31)
end
return TRUE
end
Last edited: