^ value بـ key سطر 12 بدل
ذا مثال اذا حذفت اللاعب من الجدول وكان آخر لاعب بالجدول يحطه بمتغير وتقدر تجيب المتغير بعدين :
p, last = {};
addCommandHandler ( 'add', function ( plr, _, state )
if state == '1' then
table.insert ( p, plr )
outputChatBox ( #p )
else
for k,v in ipairs ( p ) do
if v == plr then
if k == 1 then last = v end
table.remove ( p, k )
break
end
end
end
end)
addCommandHandler ( 'who', function ( )
if last and getElementType ( last ) == 'player' then
outputChatBox ( getPlayerName ( last ) )
end
end
)