• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

SOLVED - Food Lever for Training Monks (8.6)

chaotical

New Member
Joined
Jan 3, 2008
Messages
302
Reaction score
0
Location
Tokyo
Hello I am making my own 8.6 OT and I was wondering if anyone could make a script for me.

I have Training Monk - Altar Stone - Training Monk
Coal Basin- Myself - Coal Basin

I want to place a lever on the altar stone to buy food. Ham or brown mushrooms (w/e i guess i can edit that later) . You hit the lever 5 ham is bought 100 gold is removed.

Thank you in advance!
 
@chaotical
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, 100) then
doPlayerAddItem(cid, Ham_id, 5)
else
doCreatureSay(cid, "You don't have enough money!", 19)
end
end
return true
end
 
Last edited:
Thank you! It works great. Problem solved. However, for future reference, it needs a small edit.

function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, 100) then
doPlayerAddItem(cid, Ham_id, 5)
else
doCreatureSay(cid, "You don't have enough money!", 19)
end
return true
end

1 end before return true, not 2, thanks anyway!
 
Back
Top