• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Step on money and deposit

Nightimares

New Member
Joined
Feb 27, 2017
Messages
4
Reaction score
0
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) then
doPlayerAddMoney(cid, 10000)
doRemoveItem(item.uid,1)
doPlayerDepositAllMoney(cid)
doSendMagicEffect(getCreaturePosition(cid), 53)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Balance: $" .. getPlayerBalance(cid) .. "!")
else
doRemoveItem(item.uid,1)
doSendMagicEffect(getCreaturePosition(cid), 66)
end
return true
end

So basically I got this to work with 1 crystal coin but could someone make it work with more than 1 crystal coin?
 
Please read the rules; Rules for the Support board
#7

How to display CODE properly in your post

Give this a try;
LUA:
local money = {
    [2160] = 10000,
    [2152] = 1000,
    [2148] = 1
}

function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) then
        doPlayerSetBalance(cid, getPlayerBalance(cid) + money[item.itemid] * item.type)
        doRemoveItem(item.uid, item.type)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIANTICE)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Balance: $" .. getPlayerBalance(cid) .. "!")
    else
        doRemoveItem(item.uid, item.type)
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_YALAHARIGHOST)
    end

    return true
end
 
Back
Top