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

Solved lottery bug?

imback1

Unknown member
Joined
Jul 11, 2013
Messages
785
Solutions
1
Reaction score
46
sorry my friend got sad from me :S
 
Last edited:
dude. your driving me crazy... Tell me which version you use, I will download it (or better, pm me a server with the same engine you use) & I will test it & fix it for you.

PS: Next time, post which version you use...
 
dude. your driving me crazy... Tell me which version you use, I will download it (or better, pm me a server with the same engine you use) & I will test it & fix it for you.

PS: Next time, post which version you use...
calm down broo >.< its another script not urs and i wanted to add some things on it
version 0.3.6
cryingdamson 8.60
 
@imback1 dont worry im ust joking lol, I'm always glad to help... I downloaded cryingdamson 8.60 0.3.6 now, lemme take a look at the script & I'll come back to you... In the meantime just post again with what you want to add only & I will do it (i only got 15 minutes to spare so please make it fast)
 
@imback1 dont worry im ust joking lol, I'm always glad to help... I downloaded cryingdamson 8.60 0.3.6 now, lemme take a look at the script & I'll come back to you... In the meantime just post again with what you want to add only & I will do it (i only got 15 minutes to spare so please make it fast)
i understand :D
i need to put money with chance 0-71 like it is on noob items like it on action script its will be 2160 and on semi items 2157 and with rare 9971 but i need to find this money with count like from 1-100 CC on noob items and 1-50 on semi items and 1-5 on rare items like it on action script with another times
 
no offense but, why dont you just add a math.random ? cus from what i understand all what you wanna do is make cc add from 1,70 (random...)
i think you didnt read my script isn't it?
cuz i already added it 0,0 and this doesn't work >.<
 
I dont really understand you, but if you want like the cc to be from 1,70 you should edit it like this
Code:
crystal_counts = math.random(1,70),
so it adds randomly between 1-->70 cc

I just tested it,
1f670e12febc7309bd35d9a91a1c807a
 
I dont really understand you, but if you want like the cc to be from 1,70 you should edit it like this
Code:
crystal_counts = math.random(1,70),
so it adds randomly between 1-->70 cc

I just tested it,
13920a519c433e06d6df087f16c80b15
okey its on global what about action? i need to put it on action script not global what can i do?
 
brooo leave this script
i need new script on global to give me 6570/6570 like ur script and on action i need a random items 1/2/3/4 and when random item be a crystal coin i need it to be count from like 1-50 cuz when i added the id of it its gave me 1 cc only not more like my action script chance for items
 
@imback1
Code:
local noob_item = {2280}  -- put here id of most items to be won
local semi_item = {2365}  -- put here id of semi won items
local best_item = {2312}   --put id of rare items
function onUse(cid, item, fromPosition, itemEx, toPosition)
   local r = math.random(100)
     local noob = noob_item[math.random(1, #noob_item)]
       local semi = semi_item[math.random(1, #semi_item)]
         local best =  best_item[math.random(1, #best_item)]
              if r == 1 and r < 70 then
                   doPlayerAddItem(cid,noob,1)
                   doPlayerSendTextMessage(cid,25,"Lottery : you have won ["..getItemNameById(noob)..".")
                   doSendMagicEffect(getThingPos(cid),25)
                   local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 25)
end
               elseif r == 1 and r < 50 then
                   doPlayerAddItem(cid,semi,1)
                   doPlayerSendTextMessage(cid,25,"Lottery : you have won ["..getItemNameById(semi)..".")
                   doSendMagicEffect(getThingPos(cid),35)
                    local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 35)
end
               elseif r == 1 and r < 5 then
                   doPlayerAddItem(cid,best,1)
                   doSendMagicEffect(getThingPos(cid),60)
                   doPlayerSendTextMessage(cid,25,"Lottery : you have won ["..getItemNameById(best)..".")
                   doBroadcastMessage("Lottery : Congratulations! "..getCreatureName(cid).." have won a ["..getItemNameById(best).."].")
               local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
end
              end
   return doRemoveItem(item.uid)
end
this should work If i understood what you want... Tell me if it worked ;)
 
@imback1
Code:
local noob_item = {2280}  -- put here id of most items to be won
local semi_item = {2365}  -- put here id of semi won items
local best_item = {2312}   --put id of rare items
function onUse(cid, item, fromPosition, itemEx, toPosition)
   local r = math.random(100)
     local noob = noob_item[math.random(1, #noob_item)]
       local semi = semi_item[math.random(1, #semi_item)]
         local best =  best_item[math.random(1, #best_item)]
              if r == 1 and r < 70 then
                   doPlayerAddItem(cid,noob,1)
                   doPlayerSendTextMessage(cid,25,"Lottery : you have won ["..getItemNameById(noob)..".")
                   doSendMagicEffect(getThingPos(cid),25)
                   local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 25)
end
               elseif r == 1 and r < 50 then
                   doPlayerAddItem(cid,semi,1)
                   doPlayerSendTextMessage(cid,25,"Lottery : you have won ["..getItemNameById(semi)..".")
                   doSendMagicEffect(getThingPos(cid),35)
                    local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 35)
end
               elseif r == 1 and r < 5 then
                   doPlayerAddItem(cid,best,1)
                   doSendMagicEffect(getThingPos(cid),60)
                   doPlayerSendTextMessage(cid,25,"Lottery : you have won ["..getItemNameById(best)..".")
                   doBroadcastMessage("Lottery : Congratulations! "..getCreatureName(cid).." have won a ["..getItemNameById(best).."].")
               local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
end
              end
   return doRemoveItem(item.uid)
end
this should work If i understood what you want... Tell me if it worked ;)
same thing
 
@ghettobird
AHHAHA there is funny thing when i changed id on global events to 6570.6571 and when i open it ,its disappear and didn't give me any item HAHAA!!
 
i understand :D
i need to put money with chance 0-71 like it is on noob items like it on action script its will be 2160 and on semi items 2157 and with rare 9971 but i need to find this money with count like from 1-100 CC on noob items and 1-50 on semi items and 1-5 on rare items like it on action script with another times

surprisebag.lua
Code:
local prizes = {
{10, 9971, 1},
{30, 2157, 10},
{100, 2160, 50}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local r = math.random(100)
    for i=1, #prizes do
        if r <= prizes[i][1] then
            local count = math.random(prizes[i][3])
            doPlayerAddItem(cid,prizes[i][2], count)
            doSendMagicEffect(getThingPos(cid),60)
            doPlayerSendTextMessage(cid,25,"Lottery : you have won ".. count .. " "..getItemNameById(prizes[i][2])..".")
            doBroadcastMessage("Lottery : Congratulations! "..getCreatureName(cid).." has won ".. count .." "..getItemNameById(prizes[i][2])..".")
            local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
                doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
            end
        break
        end
    end
    doRemoveItem(item.uid)
return true
end
 
surprisebag.lua
Code:
local prizes = {
{10, 9971, 1},
{30, 2157, 10},
{100, 2160, 50}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local r = math.random(100)
    for i=1, #prizes do
        if r <= prizes[i][1] then
            local count = math.random(prizes[i][3])
            doPlayerAddItem(cid,prizes[i][2], count)
            doSendMagicEffect(getThingPos(cid),60)
            doPlayerSendTextMessage(cid,25,"Lottery : you have won ".. count .. " "..getItemNameById(prizes[i][2])..".")
            doBroadcastMessage("Lottery : Congratulations! "..getCreatureName(cid).." has won ".. count .." "..getItemNameById(prizes[i][2])..".")
            local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
                doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, 30)
            end
        break
        end
    end
    doRemoveItem(item.uid)
return true
end
omg finally working but i need effect 20 for low chance and effect 30 for medi chance and effect 60 for high chance
i hope you understand me like you did with the script :D
 
omg finally working but i need effect 20 for low chance and effect 30 for medi chance and effect 60 for high chance
i hope you understand me like you did with the script :D
To change the effect just change the last number in each row:

first row = rare --> current effect = 30
second row = semi --> current effect = 35
thirst row = noob --> current effect = 25

Code:
local prizes = {
{10, 9971, 1, 30},
{30, 2157, 10, 35},
{100, 2160, 50, 25}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local r = math.random(100)
    for i=1, #prizes do
        if r <= prizes[i][1] then
            local count = math.random(prizes[i][3])
            local effect = prizes[i][4]
            doPlayerAddItem(cid,prizes[i][2], count)
            doSendMagicEffect(getThingPos(cid),60)
            doPlayerSendTextMessage(cid,25,"Lottery : you have won ".. count .. " "..getItemNameById(prizes[i][2])..".")
            doBroadcastMessage("Lottery : Congratulations! "..getCreatureName(cid).." has won ".. count .." "..getItemNameById(prizes[i][2])..".")
            local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
                doSendDistanceShoot({x = position.x + math.random(-12 ,12), y = position.y + math.random(-12 ,12), z = position.z}, position, effect)
            end
        break
        end
    end
    doRemoveItem(item.uid)
return true
end
 
Back
Top