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

Lua Exausted Casino

TaurenLess

New Member
Joined
Jan 2, 2010
Messages
76
Reaction score
1
Location
Brasília / Brasil
Script Here:
Code:
--[[
        Advanced Slot Machine
             by Cybermaster   
]]--
 
--REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
local money = 1000
 
--MILISECONDS TO CHANGE FRUITS
local time = 200
 
--ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds)
local limit = 30
 
--FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH
local fruits = {2674,2675,2676,2679,2680,2682,2683,5097,8841}
 
--PRIZES TABLES
local win = {
-- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}]
        --MIXED COMBOS
        [{2679,2683,2679}] = {2160,20},  -- cherry-pumpkin-cherry
        [{8841,2682,8841}] = {2160,10},  -- lemon-melon-lemon
        --TRIPLE COMBOS
        [{2680,2680,2680}] = {2160,8}, -- triple strawberry
        [{5097,5097,5097}] = {2160,6}, -- triple mango
        [{2683,2683,2683}] = {2160,8}, -- triple pumpkin
        [{2682,2682,2682}] = {2160,5}, -- triple melon
        [{2676,2676,2676}] = {2160,4}, -- triple banana
        [{8841,8841,8841}] = {2160,3}, -- triple lemon
        [{2679,2679,2679}] = {2160,2}, -- triple cherry
        [{2675,2675,2675}] = {2160,3}, -- triple orange
        [{2674,2674,2674}] = {2160,1}, -- triple apple
        --ANY COMBOS
        [{ANY,2683,2683}] = {2160,1}, -- double pumpkin right
        [{2683,2683,ANY}] = {2160,1}, -- double pumpkin left
        [{2683,ANY,2683}] = {2160,1}, -- pumpkin sides combo
        [{ANY,2679,2679}] = {2160,1}, -- double cherry right
        [{2679,2679,ANY}] = {2160,1}, -- double cherry left
        [{2679,ANY,2679}] = {2160,1}, -- cherry sides combo
        [{ANY,8841,8841}] = {2160,1}, -- double lemon right
        [{8841,8841,ANY}] = {2160,1}, -- double lemon left
        [{8841,ANY,8841}] = {2160,1}, -- lemon sides combo
}
 
--MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS
local messages = {'Bingo!','Lucky!','Jackpot!','Win!'}

local exhaust = createConditionObject(CONDITION_EXHAUST)
		setConditionParam(exhaust, CONDITION_PARAM_TICKS, 1000)

--FRUITS ROWS
local p = { --[LEVER.UNIQUEID]
        [6297] = {}, --[6301] = {},
} --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED
for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT}
        table.insert(p[6297],i,{x=152,y=48+(i-1),z=5,stackpos=1})
        -- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1})
end
 
function verifyRow(cid, array, pos)
        local result, prize = false, ''
        for a, b in pairs(win) do
                if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then
                        if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then
                                if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then
                                        doPlayerAddItem(cid, b[1], b[2] or 1, true)
                                        doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255))
                                        result, prize, amount = true, b[1], b[2]
                                end
                        end
                end     
        end
        if prize ~= '' then 
                doPlayerSendTextMessage(cid, 22, '[Cassino System] Congratulations!! Você ganhou '..amount..' '..getItemPluralNameById(prize)..'!')
        end
        for i = 1,3 do 
                doSendMagicEffect(pos[i], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
                doRemoveItem(getTileThingByPos(pos[i]).uid)
        end
        return not result and doPlayerSendTextMessage(cid, 22, '[Cassino System] Rodada Teminada! você pode jogar de novo ou sair do cassino.')
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
        local function doFruit(pos,cid,id,limit)
                if not isPlayer(cid) then
                        return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid)
                end
                if getTileThingByPos(pos).itemid < 1 then
                        doSendMagicEffect(pos, CONST_ME_POFF)
                        doCreateItem(fruits[math.random(#fruits)], 1, pos)
                else
                        doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
                end
                if limit <= 0 then
                        doSendMagicEffect(pos,math.random(28,30))               
                        doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
                        doItemSetAttribute(getTileThingByPos(fromPosition)  .uid, 'aid', getTileThingByPos(fromPosition).actionid+1)
                        doTransformItem(getTileThingByPos(fromPosition).uid, getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826)
				elseif getTileThingByPos(fromPosition).actionid > id then
                        doSendMagicEffect(pos,math.random(28,30))
                        doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
                else
                        addEvent(doFruit,time,pos,cid,id,limit-1)
                end
        end

        if item.actionid == 0 then
                if not doPlayerRemoveMoney(cid, money) then     
                        return doPlayerSendTextMessage(cid, 22, '[Cassino System] Você precisa de '..money..' gps para jogar no cassino.')
                end
                doItemSetAttribute(item.uid, 'aid', 1)
                doCreatureSetNoMove(cid, true)
                doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
                doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED)
                for i = 1,3 do doFruit(p[item.uid][i],cid,i,i*limit) 
				end
        elseif isInArray({1,2,3},item.actionid) then
                doItemSetAttribute(item.uid, 'aid', item.actionid+1)
                doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
        elseif item.actionid == 4 then
                doCreatureSetNoMove(cid, false)
                doItemEraseAttribute(item.uid, 'aid')
                doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
                verifyRow(cid, win, p[item.uid])        
        end
		
        return true
end

Give a exausted 60 seconds per round?
Help! :D
 
Last edited:
Why doesn't anyone use the correct tags?.. jesus christ


here u go..
Lua:
--[[
        Advanced Slot Machine
             by Cybermaster   
]]--
--Storage for Exhaust.. //Milice
local exhaustStorage = 69845
--Cancel message for Exhaust.. //Milice
local cancelMessage = "You are exhausted."
--Exhaust Time (in seconds) //Milice
local eTime = 1
 
--REQUIRED MONEY(gp) TO PLAY SLOT MACHINE
local money = 1000
 
--MILISECONDS TO CHANGE FRUITS
local time = 200
 
--ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds)
local limit = 30
 
--FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH
local fruits = {2674,2675,2676,2679,2680,2682,2683,5097,8841}
 
--PRIZES TABLES
local win = {
-- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}]
        --MIXED COMBOS
        [{2679,2683,2679}] = {2160,20},  -- cherry-pumpkin-cherry
        [{8841,2682,8841}] = {2160,10},  -- lemon-melon-lemon
        --TRIPLE COMBOS
        [{2680,2680,2680}] = {2160,8}, -- triple strawberry
        [{5097,5097,5097}] = {2160,6}, -- triple mango
        [{2683,2683,2683}] = {2160,8}, -- triple pumpkin
        [{2682,2682,2682}] = {2160,5}, -- triple melon
        [{2676,2676,2676}] = {2160,4}, -- triple banana
        [{8841,8841,8841}] = {2160,3}, -- triple lemon
        [{2679,2679,2679}] = {2160,2}, -- triple cherry
        [{2675,2675,2675}] = {2160,3}, -- triple orange
        [{2674,2674,2674}] = {2160,1}, -- triple apple
        --ANY COMBOS
        [{ANY,2683,2683}] = {2160,1}, -- double pumpkin right
        [{2683,2683,ANY}] = {2160,1}, -- double pumpkin left
        [{2683,ANY,2683}] = {2160,1}, -- pumpkin sides combo
        [{ANY,2679,2679}] = {2160,1}, -- double cherry right
        [{2679,2679,ANY}] = {2160,1}, -- double cherry left
        [{2679,ANY,2679}] = {2160,1}, -- cherry sides combo
        [{ANY,8841,8841}] = {2160,1}, -- double lemon right
        [{8841,8841,ANY}] = {2160,1}, -- double lemon left
        [{8841,ANY,8841}] = {2160,1}, -- lemon sides combo
}
 
--MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS
local messages = {'Bingo!','Lucky!','Jackpot!','Win!'}

--FRUITS ROWS
local p = { --[LEVER.UNIQUEID]
        [6297] = {}, --[6301] = {},
} --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED
for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT}
        table.insert(p[6297],i,{x=152,y=48+(i-1),z=5,stackpos=1})
        -- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1})
end
 
function verifyRow(cid, array, pos)
        local result, prize = false, ''
        for a, b in pairs(win) do
                if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then
                        if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then
                                if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then
                                        doPlayerAddItem(cid, b[1], b[2] or 1, true)
                                        doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255))
                                        result, prize, amount = true, b[1], b[2]
                                end
                        end
                end     
        end
        if prize ~= '' then 
                doPlayerSendTextMessage(cid, 22, '[Cassino System] Congratulations!! Você ganhou '..amount..' '..getItemPluralNameById(prize)..'!')
        end
        for i = 1,3 do 
                doSendMagicEffect(pos[i], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT)
                doRemoveItem(getTileThingByPos(pos[i]).uid)
        end
        return not result and doPlayerSendTextMessage(cid, 22, '[Cassino System] Rodada Teminada! você pode jogar de novo ou sair do cassino.')
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
		
		if not(exhaustion.check(cid,exhaustionStorage)) then
			exhaustion.set(cid,exhaustionStorage,eTime)
		else
			doPlayerSendCancel(cid, cancelMessage)
			return true
		end
		
        local function doFruit(pos,cid,id,limit)
                if not isPlayer(cid) then
                        return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid)
                end
                if getTileThingByPos(pos).itemid < 1 then
                        doSendMagicEffect(pos, CONST_ME_POFF)
                        doCreateItem(fruits[math.random(#fruits)], 1, pos)
                else
                        doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
                end
                if limit <= 0 then
                        doSendMagicEffect(pos,math.random(28,30))               
                        doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
                        doItemSetAttribute(getTileThingByPos(fromPosition)  .uid, 'aid', getTileThingByPos(fromPosition).actionid+1)
                        doTransformItem(getTileThingByPos(fromPosition).uid, getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826)
				elseif getTileThingByPos(fromPosition).actionid > id then
                        doSendMagicEffect(pos,math.random(28,30))
                        doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1)
                else
                        addEvent(doFruit,time,pos,cid,id,limit-1)
                end
        end

        if item.actionid == 0 then
                if not doPlayerRemoveMoney(cid, money) then     
                        return doPlayerSendTextMessage(cid, 22, '[Cassino System] Você precisa de '..money..' gps para jogar no cassino.')
                end
                doItemSetAttribute(item.uid, 'aid', 1)
                doCreatureSetNoMove(cid, true)
                doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
                doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED)
                for i = 1,3 do doFruit(p[item.uid][i],cid,i,i*limit) 
				end
        elseif isInArray({1,2,3},item.actionid) then
                doItemSetAttribute(item.uid, 'aid', item.actionid+1)
                doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
        elseif item.actionid == 4 then
                doCreatureSetNoMove(cid, false)
                doItemEraseAttribute(item.uid, 'aid')
                doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826)
                verifyRow(cid, win, p[item.uid])        
        end
		
        return true
end
 
Back
Top