Forum

> > CS2D > Scripts > Spawn on Pos Lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English Spawn on Pos Lua

2 replies
To the start Previous 1 Next To the start

old Spawn on Pos Lua

Egoist
User Off Offline

Quote
i want some lua if someone has the right usgn id,to give them an option in F2 to spawn normally,or a pos i set.


F2>Spawn

You will now spawn normally.

You will now spawn on your house.

old Re: Spawn on Pos Lua

Rainoth
Moderator Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tbl = {99999}
isfine = {}

addhook("join","whoiswho")
function whoiswho(id)
	isfine[id]=0
end

addhook("serveraction","makefine")
function makefine(id,b)
	if b == 1 then
		for _,usgn in ipairs(tbl) do
			if player(id,"usgn")==usgn then
				if isfine[id]==0 then
					isfine[id]=1
					msg2(id,"Your text here")
				elseif isfine[id]==1 then
					isfine[id]=0
					msg2(id,"Your text here")
				end
			end
		end
	end
end

addhook("spawn","magic")
function magic(id)
	if isfine[id]==1 then
		timer(1000,"parse","setpos "..id.." 999 999")
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview