oh i just noticed ur talkin about ammos
so
here's a fixed version of ur script , it has some flaws
main:
while (1)
{
for (local.i = 1; local.i <= $player.size; local.i++)
{
local.player = $player[local.i]
if !( local.player != NULL && local.player != NIL && isAlive(local.player) && !local.player.ammodroped) //use the not (!) operator
{
waitThread SpawnAmmo local.player
}
}
wait 0.2
}
end
SpawnAmmo local.player:
//this array (local.bulletbox) won't work as u want it , the variable is removed/deleted once the thread reaches it's end command , it'll be filled with NILs and the last element will be current local.bulletbox , so you need to make it normal variable or level variable
local.BulletBox = spawn models/items/item_rifle_ammobox.tik
local.BulletBox.origin = local.player.origin
local.BulletBox.angles = ( 0 0 0 )
local.BulletBox.scale = 1
local.BulletBox light 0 1 1 050
local.player.ammodroped = bool 1
wait 10 // ten sec's are enough ?
local.BulletBox remove
local.BulletBox = NULL
local.player.ammodroped == bool 0
end