Forum

> > CS2D > Scripts > He ball knife
Forums overviewCS2D overview Scripts overviewLog in to reply

English He ball knife

2 replies
To the start Previous 1 Next To the start

old He ball knife

Pamoon
User Off Offline

Quote
Dear guys, i have a problems, strip knife to He Grenades...
When attack with knife, then spaw a He or Snowball to enemy or ahead. Of course: infinity he.
Like this:
1
2
3
4
5
6
7
addhook("attack","attack")
function attack(id)
	if player(id,"weapon") == 50 then
		parse("strip "..id.." 75")
	end

end
Bad Eng.

old Re: He ball knife

Rainoth
Moderator Off Offline

Quote
Your code doesn't do that in the least.

1
2
3
4
5
6
addhook("attack","boom")
function boom(id)
	if player(id,"weapontype")==50 then
		parse("spawnprojectile "..id.." 51 "..player(id,"x").." "..player(id,"y").." 350 "..player(id,"rot"))
	end
end

If you want accurate distance you'll have to use reqcld to get the position of your cursor and then calculate the distance between it and you.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview