Forum

> > CS2D > Mods > Item Spawn Random
Forums overviewCS2D overview Mods overviewLog in to reply

English Item Spawn Random

5 replies
To the start Previous 1 Next To the start

old Item Spawn Random

Cl8
User Off Offline

Quote
Hello everybody, i start in lua script and i wanna make a map with random item spawn like : only guns here, only items here, only health here etc.... ( sorry for my english i'am french ) i don't know how realise this and i have make a research but find nothing on this . And after i wanna make a lua for time on the map like dark and after 30min the sun comming and loop again

thanks a lot for you'r support

Goodbye

old Re: Item Spawn Random

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
local AA = {'timer' = 0, 'stage' = 0, 'stages' = 24, 'stagetime' = 60, 'image' = 0}

AA.image = image("gfx/block.bmp", 320, 240, 3)
imagescale(AA.image, 20, 15)

addhook("second", "AA_second")

function AA_second()
	AA.timer = AA.timer + 1
	if AA.timer == AA.stagetime then
		AA.timer = 0
		AA.stage = AA.stage + 1
		if AA.stage == AA.stages then
			AA.stage = 0
		end
	end
	local alphastage = 0.7 * (AA.stage * AA.timer) / (AA.stages * AA.stagetime)
	imagealpha(AA.image, alphastage)
end

This'd do for a day/night system prolly.

old Re: Item Spawn Random

Cl8
User Off Offline

Quote
thanks, but i have put this in a lua, after launch the lua don't work :s
To the start Previous 1 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview