Forum

> > CS2D > Scripts > Add Speedmod
Forums overviewCS2D overview Scripts overviewLog in to reply

English Add Speedmod

3 replies
To the start Previous 1 Next To the start

old Add Speedmod

Dovahkin
User Off Offline

Quote
Hey guys. I need a script which will add speed to the player whenever he buys an upgrade.

Example : parse("sethealth "..id.." "..player(id,"health")+5)

Would it work on the speedmod like this?

Example : parse("speedmod "..id.." "..player(id,"speed")+5)

I'm currently not sure what I just put in the speedmod section. I wonder how to do it like in the first example.

I need help guys. This is the whole script.

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
addhook("serveraction","actinn")
function actinn(id,actin)
	if actin==2 then
		menu(id,"Skill Points - Can all be upgraded 10 times@b,Increase HP by 10%|Costs : 1 aura points,Increase Armor by 10%|Costs : 1 aura points,Increase Speed by 0.2%|Costs : 1 aura points")
	end
end

addhook("menu","testtt")
function testtt(id,t,b)
	if (t=="Skill Points - Can all be upgraded 5 times") then
		if b==1 then
			if aura[id] >=1 then
				aura[id] = aura[id]-1
				parse("setmaxhealth "..id.." "..player(id,"health")+11)
				updated(id)
			elseif aura[id] >=0 then
				msg2(id,"Not enough aura points!@C")
			end
		end
		if b==2 then
			if aura[id] >=1 then
				aura[id] = aura[id]-1
				parse("setmaxarmor "..id.." "..player(id,"armor")+4)
				updated(id)
			elseif aura[id] >=0 then
				msg2(id,"Not enough aura points!@C")
			end
		end
		if b==3 then
			if aura[id] >=1 then
				aura[id] = aura[id]-1
				parse("speedmod "..id.." 4")
				updated(id)
			elseif aura[id] >=0 then
				msg2(id,"Not enough aura points!@C")
			end
		end
	end
end

But the speedmod part stays "4" rather than adding "4" speed to the player.

I need help! Ty.

old Re: Add Speedmod

MikuAuahDark
User Off Offline

Quote
it's
1
player(id,"speedmod")
not
1
player(id,"speed")

And replace line 32 with this
1
parse("speedmod "..id.." "..player(id,"speedmod")+4)

old Re: Add Speedmod

EngiN33R
Moderator Off Offline

Quote
Yes, it would, see user MikuAuahDark's answer above.

Also, the title of your menu in the serveraction function (Skill Points - Can all be upgraded 10 times) does not match the one in the menu function (Skill Points - Can all be upgraded 5 times).
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview