• 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 Help with script

marcuz90

New Member
Joined
Apr 19, 2011
Messages
48
Reaction score
0
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:
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
 
im not sure if lua has while loops but u could test that ^^
think in lua its like:
local times = 1

while times < 50 do

Stuff
times = times+1

end

:example:
while 1 do

Stuff here

end
 
Back
Top