calm down broo >.< its another script not urs and i wanted to add some things on itdude. 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...
i understand@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 think you didnt read my script isn't it?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...)
crystal_counts = math.random(1,70),
okey its on global what about action? i need to put it on action script not global what can i do?I dont really understand you, but if you want like the cc to be from 1,70 you should edit it like this
so it adds randomly between 1-->70 ccCode:crystal_counts = math.random(1,70),
I just tested it,
![]()
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
same thing@imback1
this should work If i understood what you want... Tell me if it workedCode: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![]()
i understand
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
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 chancesurprisebag.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
To change the effect just change the last number in each row: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![]()
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