nrealSoftWare! Today i got an new idea to make Disasters server where players need to survival in random map! But my code wont to work
. So there is code:edited 1×, last 05.03.15 06:33:11 pm
Scripts
Script not working. (random map choice)
Script not working. (random map choice)
1

nrealSoftWare! Today i got an new idea to make Disasters server where players need to survival in random map! But my code wont to work
. So there is code:
muxarus: maps = {
	[1] = {
		name = "zombieApocalypse",
		x=10,
		y=10,
	},
	[2] = {
		name = "Flood",
		x=20,
		y=20,
	},
	[3] = {
		name = "ebola",
		x=30,
		y=30,
	},
	[4] = {
		name = "combine_invasion",
		x=40,
		y=40,
	}
}
color = {
	[1] = 169255220,
	[2] = 169255255,
	[3] = 169255000,
	[4] = 169000255,
	[5] = 169000000,
	[6] = 169220220,
	[7] = 169064179,
	[8] = 169255025,
	[9] = 169050150,
	[10] = 169100100,
	}
}
addhook("spawn","_start")
function _start(id)
	getmap = math.random(1,4)
	getcolor = math.random(1,10)
	currentmap = maps[getmap].name
	currentmapX = maps[getmap].x
	currentmapY = maos[getmap].y
	timer(1000,"msg","MAP WILL BE CHOISED IN 3 SECONDS")
	timer(2000,"msg","MAP WILL BE CHOISED IN 2 SECONDS")
	timer(3000,"msg","MAP WILL BE CHOISED IN 1 SECONDS")
	timer(4000,"msg","MAP CHOISED ©"..getcolor.." "..maps[getmap].name.." ")
parse("setpos "..id.." "..currentmapX.." "..currentmapY)
end
RedizGaming: its working but i have bugs
for example: every text have letter A, and somewhere text just replacing to letter A
muxarus: change encoding or use\169RRRGGGBBB
maps = {
	[1] = {
		name = "zombieApocalypse",
		x = 10,
		y = 10,
	},
	[2] = {
		name = "Flood",
		x = 20,
		y = 20,
	},
	[3] = {
		name = "ebola",
		x = 30,
		y = 30,
	},
	[4] = {
		name = "combine_invansion",
		x = 40,
		y = 40,
	}
}
color = {
	[1] = 169255220,
	[2] = 169255255,
	[3] = 169255000,
	[4] = 169000255,
	[5] = 169000000,
	[6] = 169220220,
	[7] = 169064179,
	[8] = 169255025,
	[9] = 169050150,
	[10] = 169100100,
}
addhook("spawn","_start")
function _start(id)
	local getmap = math.random(1,4)
	local getcolor = math.random(1,10)
	local currentmap = maps[getmap].name
	local currentmapX = maps[getmap].x
	local currentmapY = maps[getmap].y
timer(1000,"msg","MAP WILL BE CHOISED IN 3 SECONDS")
timer(2000,"msg","MAP WILL BE CHOISED IN 2 SECONDS")
timer(3000,"msg","MAP WILL BE CHOISED IN 1 SECONDS")
timer(4000,"msg","MAP CHOISED ©"..getcolor.." "..maps[getmap].name.." ")
	timer(5000,"parse","setpos "..id.." "..currentmapX.." "..currentmapY.." ")
end
1
