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

[REQUEST] Casino System and Buy System

Status
Not open for further replies.

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
I need one casino system perfect' :)

- The player use one (ACTIONID - 19486) and the player must have one DICE,one item "X".
- And when the player wins he speaks "Wooo! Its your lucky day. You won a crystal coin!"(1 Crystal Coin, not more) and lose: "It is your unlucky day! You lost."

2º Script Buy System.
- The player use one (actionid) and buy one dice for 300 gp and other item for 300 gp.(PS: are ACTION ID different.)

thx all ^_^
 
2. Here you have MOD (you can change it some):
Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="action-shop" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
    <config name="action-shop-config"><![CDATA[
        items = {
            -- health potions
            [3001] =    {itemid = 7618,    cost = 1000, backpack = 2000, name = "backpack of health potions"},
            [3002] =    {itemid = 7588,    cost = 2100, backpack = 2000, name = "backpack of strong health potions"},
            [3003] =    {itemid = 7591,    cost = 3900, backpack = 2000, name = "backpack of great health potions"},
            [3004] =    {itemid = 8473,    cost = 6300, backpack = 2000, name = "backpack of ultimate health potions"},

            -- mana potions
            [3005] =    {itemid = 7620,    cost = 1100, backpack = 2001, name = "backpack of mana potions"},
            [3006] =    {itemid = 7589,    cost = 1700, backpack = 2001, name = "backpack of strong mana potions"},
            [3007] =    {itemid = 7590,    cost = 2500, backpack = 2001, name = "backpack of great mana potions"},

            -- spirit potions
            [3008] =    {itemid = 8472,    cost = 3900, backpack = 1999, name = "backpack of great spirit potions"},

            -- runes
            [3009] =    {itemid = 2268,    cost = 7100, backpack = 2003, name = "backpack of sudden death runes",        charges = 3},
            [3010] =    {itemid = 2273,    cost = 6100, backpack = 2002, name = "backpack of ultimate healing runes",    charges = 2},

            -- other
            [3011] =    {itemid = 2120,    cost = 50,    name = "rope"},
            [3012]=        {itemid = 2554,    cost = 40,    name = "shovel"},
            [3013]=        {itemid = 2109,    cost = 20000,    name = "football"}
        }
    ]]></config>

    <action fromaid="3001" toaid="3013" event="script"><![CDATA[
        domodlib('action-shop-config')
        local items = items

        function onUse(cid, item, fromPosition, itemEx, toPosition)
            local tmp = items[item.actionid]
            if(not tmp) then
                error('ERROR - action-shop mod: actionid is empty.')
                return false
            end

            local count = (tmp.count ~= nil and tmp.count or 1)
            local charges = (tmp.charges ~= nil and tmp.charges or 1)

            if(tmp.backpack) then
                if(doPlayerBuyItemContainer(cid, tmp.backpack, tmp.itemid, 1, tmp.cost, charges)) then
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought a " .. tmp.name .. ".")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
                end
            else
                if(doPlayerBuyItem(cid, tmp.itemid, count, tmp.cost, charges)) then
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. tmp.name .. ".")
                else
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have enought money. (" .. tmp.cost .. "gp)")
                end
            end

            return true
        end
    ]]></action>
</mod>
Script isn't my!
 
Status
Not open for further replies.
Back
Top