Hello, I'm trying to make a loop that checks "if randomized number is under a specified number, and over another number". Lets say under 200 and over 0, then I get an item from t[]. Afterwards, I need to do +200 on both numbers. Then its under 400 and over 200. And then it loops.
The problem is, I don't know how to loop it ??
This is what I've done so far:
The problem is, I don't know how to loop it ??
This is what I've done so far:
Code:
local t = {
[1] = 2400, -- MAGIC SWORD
[2] = 2656, -- BLUE ROBE
[3] = 2646, -- GOLDEN BOOTS
[4] = 2564 -- FORK
}
function onKill(cid, target, lastHit)
maxrandom = 1000
minrandom = 200
minrandom2 = 0
totalrandom = math.random(maxrandom)
if(totalrandom < minrandom and > minrandom2) then
doPlayerAddItem(cid, t[1])
end
return true
end