• 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 More Places

Mera Mero

Guess Who?
Joined
Dec 27, 2014
Messages
417
Reaction score
86
Hello otlanders ,i have got casino mod ,my problem is how can i add more places with this? cuz there is one place only and when i tried to put comma gave me many errors
@Flatlander
@Limos
Code:
<?xml version="1.0" encoding="utf-8"?>
<mod name="Casino lever2" enabled="yes">
  <action uniqueid="5889" event="script"><![CDATA[
        local pos = {x=932, y=818, z=8, stackpos = 255}
    
        local cash = 2160
        local t = {
        [{1, 70}] = 0,
        [{71, 90}] = 2,
        [{91, 100}] = 3
    }
        local a, b = getItemInfo(cash).name, getItemInfo(cash).plural

        function onUse(cid, item, fromPosition, itemEx, toPosition)
            local v = getThingfromPos(pos)
            if v.itemid ~= cash then
                return doCreatureSay(cid, 'Only ' .. b .. '.', TALKTYPE_ORANGE_1, false, cid)
            end

            local r = math.random(100)
            for i, k in pairs(t) do
                if r >= i[1] and r <= i[2] then
                    doRemoveItem(v.uid)
                    if k < 1 then
                        doCreatureSay(cid, 'You Lost ' .. v.type .. ' ' .. (v.type == 1 and a or b) .. ' :(', TALKTYPE_ORANGE_1, false, cid)
                        doSendMagicEffect(pos, CONST_ME_POFF)
                    else
                        doCreatureSay(cid, 'You Win ' .. v.type * k .. ' ' .. (v.type == 1 and a or b) .. ' :)', TALKTYPE_ORANGE_1, false, cid)
                        doCreateItem(cash, v.type * k, pos)
                        doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
                        doSendMagicEffect(toPosition, CONST_ME_SOUND_YELLOW)
                    end
                    return true
                end
            end
        end
    ]]></action>
</mod>
 
Last edited:
Back
Top