Forum

> > CS2D > Scripts > On/Off gate as Script.
Forums overviewCS2D overview Scripts overviewLog in to reply

English On/Off gate as Script.

10 replies
To the start Previous 1 Next To the start

old On/Off gate as Script.

Man Of Steel
User Off Offline

Quote
Hello everyone,

i need some help.

I'm using a script for teleport a player in a new place if he kill 10 or more players.

Script below:
Spoiler >


I made a room in my map where a new place if anybody kill 10 or more players, i want this room gate only operate/use by them who killed 10 or more players if 1 or more players got this room so he can use.
i set Gate names to "mygate"

Please help anybody can make this script for me.

old Re: On/Off gate as Script.

Quattro
GAME BANNED Off Offline

Quote
...You didn't even remove my debugger? It sends hud every 100ms you know

Learn how it works before trying to do difficult stuff

old Re: On/Off gate as Script.

minos
User Off Offline

Quote
try this one :
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
49
50
51
52
53
--------------------------
---Teleportation jutsu----
--------------------------
tilex = 23
tiley = 1

--------------------------
----Score requirements----
--------------------------
score_max = 10
---------------
-----Setup-----
---------------
kills = 0
use_gate = {}
for i = 1, 32 do ace[i] = 0 end
addhook("spawn","_spawn")
addhook("ms100","debugger")
addhook("join","_join")
addhook("kill","_kill")

---------------
---Functions---
---------------
function debugger()
    parse('hudtxt 0 "©255255255P1Ace?: ['..ace[1]..']   P1Kills: ['..player(1,'score')..']   P1Deaths: ['..player(1,'deaths')..']" 100 100 0 0 20')
end

function _spawn(id)
if use_gate[id] == true then 
local x = tilex * 32 + 16
local y = tiley * 32 + 16
parse('setpos '..id..' '..x..' '..y)
msg2(id,'©255255255New Place')
end
end

function kill(k,v)
kills[k] = kills[k] + 1 
	if kills[k] > score_max then 
		if player(k,"deaths") <= 0 then 
			if use_gate == false then 
				use_gate[k] = true
				kills[k] = 0
			end
		end
	end
end

function _join(id)
use_gate[id] = false
kills[id] = 0 
end

PS : I didn't test it.

old Re: On/Off gate as Script.

KingShadow
User Off Offline

Quote
give me x and y of your gate you can find it in map editor of your map in the down of the screen x|y thats tile position give me it :v
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview