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

nvm fixed

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
why table.roemove dont work here?
LUA:
function eventStart()
	 players = {}
            for v = frompos.x , topos.x do
				for k = frompos.y , topos.y do
					for i = 1, 200 do
						position = {x = v, y = k, z = 7, stackpos = i}
						pid = getThingfromPos(position).uid
							if(pid ~= nil and isPlayer(pid)) then
								table.insert(players, pid)
							end
					end
				end
	     end
	     if math.mod(#players, 2) ~= 0 then	
                                doTeleportThing(players[1],{x=94,y=125,z=7},false)
				doSendMagicEffect(getThingPosition(players[1]),10)
				doPlayerSendTextMessage(players[1], 19, table.concat(players,",").."")	
				for i = 1,#players do
				table.remove(players,players[i])
			    end
			    doPlayerSendTextMessage(players[1], 19, table.concat(players,",").."")		 
	     end
end
 
table.remove should work, but you can try this:
LUA:
for i = 1,#players do
	table.remove(players) --only put the table to remove the last item on table
 end

it will remove all items in table too
 
Back
Top