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

Slot Machine problem

Status
Not open for further replies.

5mok3

Emporia
Joined
Jan 18, 2009
Messages
1,767
Reaction score
25
Location
California, US
A friend send this script to me
because i wanted to add a casino in my server
but the script doesn't work.. it removes the tokens used to play..
but it gives no prize

Code:
function onUse(cid, item, frompos, item2, topos)
if item2.itemid == 3981 and
doPlayerRemoveItem (cid,2157,1) == 1 then
rand = math.random(1,2000)
if rand < 20 then
doPlayerRemoveItem (cid,2157,1)
doPlayerSendTextMessage(cid,9,"Oh No! Que Pena :s!")
doSendMagicEffect(topos,26)
doPlayerRemoveItem(cid,2160,4)
elseif rand >1100 and rand <1400 then
doPlayerRemoveItem(cid,2160,3)
doSendMagicEffect(topos,26)
doPlayerSendTextMessage(cid,9,"Oh No! Que Pena :s!")
elseif rand >300 and rand <600 then
doPlayerAddItem(cid,2160,4)
doSendMagicEffect(topos,26)
doPlayerSendTextMessage(cid,9,"Oh Oh! Que Suerte :)!.")
elseif rand >700 and rand <1000 then
doPlayerAddItem(cid,2160,3)
doSendMagicEffect(topos,26)
doPlayerSendTextMessage(cid,9,"Oh Oh! Que Suerte :)!.")
end
else
doPlayerSendCancel(cid, "Necesitas 1 ficha para poder jugar.")
end
return 1
end

hope u guys can help
thx
 
Not Tested: 0.3.4
Lua:
function onUse(cid, item, fromPos, item2, toPos)
local token = 2157
local rand = math.random(1,2000)
    if (item.itemid == 3981) then
        doPlayerRemoveItem(cid, token, 1)
    end
    elseif rand < 20 then
        doPlayerRemoveItem (cid, token, 1)
        doPlayerSendTextMessage(cid,9,"Oh No! Que Pena :s!")
        doSendMagicEffect(topos,26)
        doPlayerRemoveItem(cid,2160,4)
    end
    elseif rand > 1100 and rand < 1400 then
        doPlayerRemoveItem(cid,2160,3)
        doSendMagicEffect(topos,26)
        doPlayerSendTextMessage(cid,9,"Oh No! Que Pena :s!")
    end
    elseif rand > 300 and rand < 600 then
        doPlayerAddItem(cid,2160,4)
        doSendMagicEffect(topos,26)
        doPlayerSendTextMessage(cid,9,"Oh Oh! Que Suerte :)!")
    end
    elseif rand > 700 and rand < 1000 then
        doPlayerAddItem(cid,2160,3)
        doSendMagicEffect(topos,26)
        doPlayerSendTextMessage(cid,9,"Oh Oh! Que Suerte :)!")
    end
    else
        doPlayerSendCancel(cid, "Necesitas 1 ficha para poder jugar.")
    end
    return TRUE
end
 
Last edited:
[31/07/2009 18:04:43] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/tragaperras.lua)
[31/07/2009 18:04:43] data/actions/scripts/tragaperras.lua:7: 'end' expected (to close 'function' at line 3) near 'elseif'

can u fix plz?
 
Status
Not open for further replies.
Back
Top