Forum
CS2D Scripts Special power when pressing T button only for zombSpecial power when pressing T button only for zomb
10 replies 1
mrc has written
just use addbind
If you're not willing to give helpful information don't mislead him, you know what I'm talking about.
@ DX learn how to ask for help, give us a flow chart of what you intend the script to do.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--untested timeInMillis = 10000 speedmod = 20 addhook("spray","_s") function _s(id) 	if player(id,"team")==1 then 		parse("speedmod "..id.." "..speedmod) 		timer(timeInMillis,"resetSpeed",id) 	end end function resetSpeed(id) 	parse("speedmod "..id.." 0") end
edited 1×, last 01.11.20 12:31:47 pm
edit:i fix it thx
edit:but i have problem when i press T i can Press T again i want cooldown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--untested timeInMillis = 10000 speedmod = 20 addbind("T") addhook("key","_s") function _s(id,key) 	if (key == "T") then if player(id,"team")==1 then parse("speedmod "..id.." "..speedmod) timer(timeInMillis,"resetSpeed",id) 	 end end end function resetSpeed(id) parse("speedmod "..id.." 0") end
edited 1×, last 01.11.20 12:34:39 pm
of course it has to be
addhook("spray","_s")instead of
addbind("spray","_s")*facepalm*
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
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
--untested function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end speedTime = 10000 cooldownTime = 10000 speedmod = 20 cooldownFlag = initArray(32) addhook("spray","_s") function _s(id) if player(id,"team")==1 and cooldownFlag[id]==0 then parse("speedmod "..id.." "..speedmod) cooldownFlag[id] = 1 timer(timeInMillis,"resetSpeed",id) end end function resetSpeed(id) parse("speedmod "..id.." 0") timer(cooldownTime,"resetCooldown",id) end function resetCooldown(id) 	cooldownFlag[id] = 0 end
1