Forum

> > CS2D > Scripts > King room
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch King room

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt King room

Man Of Steel
User Off Offline

Zitieren
Hello guys, i need a script .. i hope somebody will help me

I want, when a player kill 12 or 15 kills in a round, his game will start from different place in a next round, actually i made a room in my map and i want Only 12 kills Killer can open use this room as a reward and can Open gate of this room and after completing reward round, his game will normally start like normal players ...
1× editiert, zuletzt 06.12.18 18:55:41

alt Re: King room

-3Jlou_nTu4-
User Off Offline

Zitieren
You gave too little information, what exactly do you want and under what conditions, for example, this script will work only in standard rounds

How it work:
If there is a king, the time is allocated during which the reward round takes place. At this time, all players except the king cannot move, after the reward time, the king returns to his start position and all players get the opportunity to move.

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
local KINGROOM_TILEX = 1	--x position of king room in TILE
local KINGROOM_TILEY = 1	--y position of king room in TILE
local KINGROOM_REWARDTIME = 2	--reward round time in SECONDS

local plPrevSpeed = {}
local kingPrevPos = nil

addhook("startround", "startround_proc")

function rewardTimeOff(plid)
	if player(plid, "health")>0 then
		parse("setpos "..tostring(plid)..' '..tostring(kingPrevPos.x)..' '..tostring(kingPrevPos.y))
	end

	for _, val in pairs(playerlist) do
		if val~=plid and plPrevSpeed[val] then
			parse("speedmod "..tostring(val)..' '..tostring(plPrevSpeed[val]))
		end
	end
end

function rewardTime(plid)
	local playerlist = player(0, "table")

	for _, val in pairs(playerlist) do
		if val~=plid then
			plPrevSpeed[val] = player(plid, "speedmod")
			parse("speedmod "..tostring(val).." -100")
		end
	end

	timer(KINGROOM_REWARDTIME * 1000, "rewardTimeOff", tostring(plid), 1)
end

function startround_proc(mode)
	local playerlist = player(0, "table")

	for _, plid in pairs(playerlist) do
		if player(plid, "score")==12 or player(plid, "score")==15 then
			kingPrevPos =
				{
				x = player(plid, "x"),
				y = player(plid, "y")
				}
			parse("setpos "..tostring(plid)..' '..tostring(KINGROOM_TILEX*32+16)..' '..tostring(KINGROOM_TILEY*32+16))
			rewardTime(plid)
			break
		end
	end
end
2× editiert, zuletzt 06.12.18 14:41:24

alt Re: King room

KingShadow
User Off Offline

Zitieren
@user -3Jlou_nTu4-: He won't understand this kind of code if he wants to edit it later

just make it simple like that
Spoiler >
1× editiert, zuletzt 06.12.18 15:50:14
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht