Forum

> > CS2D > Scripts > Spawn random items and limited
Forums overviewCS2D overview Scripts overviewLog in to reply

English Spawn random items and limited

1 reply
To the start Previous 1 Next To the start

old Spawn random items and limited

Carcass
User Off Offline

Quote
Hello all,
just if it's not hard and possible to do:
how to random spawn 3 items:
[coins,money,gold] in map,
this items spawned maximum 10.
Script check map-if item with id 66(coins) or 67 ot 68 in map is 10 - script will not spawn it anymore. if it 9 or small it will again spawn for being 10, spawntimer 60 sec.
Sorry me bad english i from russian
/i writte it too fast, sorry, if i will onger it will be better.. if it is not understandable i can re-writte it.

old Re: Spawn random items and limited

Rainoth
Moderator Off Offline

Quote
Loop the whole map, in accessible places spawn your items and record their coordinates. All of the coordinates are stored in a table. When a person collects an item, it checks if it's one of the locations (you do that by looping the table with locations). When it's time to spawn again, you loop 10 - (length of your table). That's one way to do it.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview