Forum

> > CS2D > Scripts > Barbed wire
Forums overviewCS2D overview Scripts overviewLog in to reply

English Barbed wire

22 replies
Page
To the start Previous 1 2 Next To the start

old Barbed wire

mr-quick
User Off Offline

Quote
Help me ! Barbed wire is pressed, could make to the teleport back?

Sorry, My Bad English. Help me Pls!!

old Re: Barbed wire

useigor
User Off Offline

Quote
user mr-quick, use portal gun. If you are admin then write this in console:
1
equip 1 88
1 - your ID.
88 - portal gun ID.

Portals much better than teleports.

old Re: Barbed wire

mr-quick
User Off Offline

Quote
i Know . İ Searcing Go Barbed Wire and teleport back

have l4n biohazard lua to barbed wire..

old Re: Barbed wire

limonata
User Off Offline

Quote
He means when the player on barbed wire he will get setpos to back.

old Re: Barbed wire

Jela331
User Off Offline

Quote
He wants a script in which, when the player touches a barbed wire, the wire gets damaged and it teleports the player back. He can only pass when the barbed wire is destroyed.

old Re: Barbed wire

mr-quick
User Off Offline

Quote
I need this script: when the player is on barbed wire he should be setpos to back.

old Re: Barbed wire

Cure Pikachu
User 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
32
33
34
35
36
37
38
39
40
41
42
43
function initArray(i,x,d)
	local array = {}
	if type(i) == "table" then
		array = i
		i = x
		x = d
	end
	if x == nil then
		x = 0
	end
	for m = 1 , i do
		if array[m] == nil then
			array[m] = x
		end
	end
	return array
end

prex = initArray(32)
prey = initArray(32)

addhook("join","nopass_reset")
addhook("leave","nopass_reset")
function nopass_reset(id)
	prex[id] = 0
	prey[id] = 0
end

addhook("movetile","nopass_movetile")
function nopass_movetile(id,x,y)
	for _, oid in ipairs(object(0,"table")) do
		if object(oid,"type") == 2 then
			if x == object(oid,"tilex") and y == object(oid,"tiley") then
				local px = prex[id]*32+16
				local py = prey[id]*32+16
				parse("setpos "..id.." "..px.." "..py)
				return
			end
		end
	end
	prex[id] = x
	prey[id] = y
end
Tested in my "test chamber" - Works way too effectively.

old Re: Barbed wire

mr-quick
User Off Offline

Quote
Player musnt move 1 second after touch the barbed wire. Like stun help me pls

old Re: Barbed wire

Cure Pikachu
User Off Offline

Quote
Here you go.
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
function initArray(i,x,d)
	local array = {}
	if type(i) == "table" then
		array = i
		i = x
		x = d
	end
	if x == nil then
		x = 0
	end
	for m = 1 , i do
		if array[m] == nil then
			array[m] = x
		end
	end
	return array
end

prex = initArray(32)
prey = initArray(32)
spd = initArray(32)

addhook("join","nopass_reset")
addhook("leave","nopass_reset")
function nopass_reset(id)
	prex[id] = 0
	prey[id] = 0
	spd[id] = 0
end

addhook("movetile","nopass_movetile")
function nopass_movetile(id,x,y)
	for _, oid in ipairs(object(0,"table")) do
		if object(oid,"type") == 2 then
			if x == object(oid,"tilex") and y == object(oid,"tiley") then
				local px = prex[id]*32+16
				local py = prey[id]*32+16
				parse("setpos "..id.." "..px.." "..py)
				parse("speedmod "..id.." -100")
				timer(1000,"parse","speedmod "..id.." "..spd[id])
				return
			end
		end
	end
	prex[id] = x
	prey[id] = y
	spd[id] = player(id,"speedmod")
end
Once again it's tested - It works.

old Re: Barbed wire

mr-quick
User Off Offline

Quote
Pikachu You Amaizing LUA CODER! Thank YOU!

but add zombies only teleport back?

but does not work
edited 2×, last 30.01.13 11:33:57 am

old Re: Barbed wire

Cure Pikachu
User Off Offline

Quote
Oh boy...
Code >

old Re: Barbed wire

omg
User Off Offline

Quote
wtf..."but does not work" could mean anything. if it worked for pika, be more specific

old Re: Barbed wire

mr-quick
User Off Offline

Quote
can't not move after pressing is the have problem.

PLS HELP ME !! >
edited 1×, last 01.02.13 04:03:57 pm
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview