• 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!

Buy item with a lever [not normal cash]

Tobb3ForTheWin

d(^^,)b
Joined
Oct 18, 2009
Messages
45
Reaction score
0
Location
Sweden
heya OTlanders i wonder if anyone would like to make a script for me , i pull a lever it takes 30 christmas tokens from me and i recieve a item.

Thanks in advance yours Tobbe :)
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=971, y=961, z=8} -- if you want effect that says thanks!
if item.itemid == 1945 and (doPlayerRemoveItem(cid, 6527, 3) == TRUE) and getPlayerFreeCap(cid) >= 100 then
doPlayerAddItem(cid, 10503, 1) ---- the item
doPlayerSendTextMessage(cid,21,"You bought an Donate Outfitbox!, Thanks for supporting this server!")
doSendAnimatedText(pos, "Thanks!", 215)
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 and getPlayerFreeCap(cid) >= 85 then
doPlayerSendTextMessage(cid,21,"Please Try Again!")
doTransformItem(item.uid, item.itemid - 1)
else
doPlayerSendCancel(cid,"You don't got enought vip coins or cap!")
end
return TRUE
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pos = {x=971, y=961, z=8} -- if you want effect that says thanks!
if item.itemid == 1945 and (doPlayerRemoveItem(cid, 6527, 3) == TRUE) and getPlayerFreeCap(cid) >= 100 then
doPlayerAddItem(cid, 10503, 1) ---- the item
doPlayerSendTextMessage(cid,21,"You bought an Donate Outfitbox!, Thanks for supporting this server!")
doSendAnimatedText(pos, "Thanks!", 215)
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 and getPlayerFreeCap(cid) >= 85 then
doPlayerSendTextMessage(cid,21,"Please Try Again!")
doTransformItem(item.uid, item.itemid - 1)
else
doPlayerSendCancel(cid,"You don't got enought vip coins or cap!")
end
return TRUE
end

thanks alot mate! rep+
 
Mmm....
Only a help...
1. If you want the message with thanks... You dont need the position... Only sendAnimatedText on cid.... so it's easier and the code is little.... xD

2. Use locals to do it configurable so u dont need to write instructions on script.... So u only explain locals after post script....

3. Only a help....
 

Similar threads

Back
Top