ok nevermind that last post (how do you edit?)
anyway now i have a new proble...well a few but the other one is minor
see here it is
i got the multiple barracks like i wanted to i go onto the next thing and that is to make a troops
so i set my troop key arrays and debounces and all that and well i debug and smooth out the errors
well theres the problem

when i press the button to make the troop come out of a random barracks then i dont get a troop
its confusing me and i dont know why
also when i place the second barracks it places the third one at the same time i know that it does that because i was testing it one time and i places the second one while moving upwards and the hird one popped just a few pixels above the second one......any fix for that would be great
i cleanned up my code a bit i hope its readable
sync on
sync rate 30
nomore = 0
p1x=5
p1y=screen height()/2
p2x=screen width()-5
p2y=screen height()/2
rem player 2 barracks data
barracks = 3
dim debounce(barracks)
dim barracksx(barracks)
dim barracksy(barracks)
rem player 2 troop data
amm = 5
dim troops(amm)
dim troopx(amm)
dim troopy(amm)
rem debounce data
nnn = 0
nn = 0
rem game loop
do
hide mouse
cls
ink RGB(0,255,255),RGB(0,0,0)
circle p1x,p1y,4
ink RGB(255,0,0),RGB(0,0,0)
circle p2x,p2y,4
print scancode()
if keystate(17)=1 then p1y = p1y-5
if keystate(31)=1 then p1y = p1y+5
if keystate(30)=1 then p1x = p1x-5
if keystate(32)=1 then p1x = p1x+5
if p1y >= screen height() then p1y = 1
if p1y <= 0 then p1y = screen height()
if p1x >= screen width() then p1x = 1
if p1x <= 0 then p1x = screen width()+1
if keystate(200)=1 then p2y = p2y-5
if keystate(208)=1 then p2y = p2y+5
if keystate(203)=1 then p2x = p2x-5
if keystate(205)=1 then p2x = p2x+5
rem make a troop for player 2
if keystate(52)=1
if nn > 0
number = rnd(nn)
xx = barracksx(number)
yy = barracksy(number)
rem now heres the problem. when i press 52 (the .> key) it does not make a troop and i get no error
makeTroop(xx,yy)
endif
endif
rem bar could be the flag for the barracks. If it's 1
rem then draw the barracks every loop
if keystate(53)=1
bar=1
gosub makeBarracks
endif
if bar=1 then gosub drawBarracks
gosub drawTroops
if p2y >= screen height() then p2y = 1
if p2y <= 0 then p2y = screen height()
if p2x >= screen width() then p2x = 1
if p2x <= 0 then p2x = screen width()+1
sync
loop
drawBarracks:
for n=1 to barracks
circle barracksx(n),barracksy(n),10
next n
return
makeBarracks:
inc nn
if nn > barracks then nn=barracks
if debounce(nn) = 0
debounce(nn)=1
barracksx(nn) = p2x
barracksy(nn) = p2y
endif
Return
drawTroops:
for n=1 to amm
if troops(n) = 1
circle troopx(n),troopy(n),2
endif
next n
return
function makeTroop(x,y)
inc nnn
if nnn > amm then nnn = amm
troops(nnn)=1
troopx(nnn) = x
troopy(nnn) = y
endfunction