Forum

> > CS2D > Scripts > spawn place with usgn id
Forums overviewCS2D overview Scripts overviewLog in to reply

English spawn place with usgn id

5 replies
To the start Previous 1 Next To the start

old Re: spawn place with usgn id

Apache uwu
User Off Offline

Quote
Like this?

1
2
3
4
5
6
7
8
9
function moveUSID(usid,x,y)
	for _,id in pairs(player(0,"tableliving")) do
		if player(id,"usgn")==usid then
			parse("setpos "..id.." "..x.." "..y)
		end
	end
end

moveUSID(52331,480,640)

I'm not really sure what you mean though.

old Re: spawn place with usgn id

Black Wolf
User Off Offline

Quote
user Apache uwu has written
Like this?

1
2
3
4
5
6
7
8
9
function moveUSID(usid,x,y)
	for _,id in pairs(player(0,"tableliving")) do
		if player(id,"usgn")==usid then
			parse("setpos "..id.." "..x.." "..y)
		end
	end
end

moveUSID(52331,480,640)

I'm not really sure what you mean though.


is it that like when you die you will spawn on these coordinates

old Re: spawn place with usgn id

Apache uwu
User Off Offline

Quote
Automatic spawning?

1
2
3
4
5
6
addhook("die","_die")

function _die(id)
	local x,y=randomentity(player(id,"team"))
	parse("spawnplayer "..id.." "..(x*32+16).." "..(y*32+16))
end

Or maybe different spawn positions?

1
2
3
4
5
addhook("spawn","_spawn")

function _spawn(id)
	parse("setpos "..id.." 480 640")
end

Please explain, one sentence isn't going to help.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview