Forum

> > CS2D > Scripts > spawn snowball after throw
Forums overviewCS2D overview Scripts overviewLog in to reply

English spawn snowball after throw

4 replies
To the start Previous 1 Next To the start

old spawn snowball after throw

knight-
User Off Offline

Quote
Hi! I want a code that can snowball at same place after throw.
I can write lua script but this time is hard for me.
Plz help me.

old Re: spawn snowball after throw

Suprise
BANNED Off Offline

Quote
1
2
3
4
5
6
addhook("hit","snow_attack")
function snow_attack(id,source,weapon)
	if weapon == 75 then
		parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
	end
end

This is better
1
2
3
4
addhook("attack","snow_attack")
function snow_attack(id)
parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
end

But with this if you attack with knife or other guns, it will always spawn a snowball, sad

old Re: spawn snowball after throw

Happy eyes
User Off Offline

Quote
user Suprise has written
1
2
3
4
5
6
addhook("hit","snow_attack")
function snow_attack(id,source,weapon)
	if weapon == 75 then
		parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
	end
end

This is better
1
2
3
4
addhook("attack","snow_attack")
function snow_attack(id)
parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
end

But with this if you attack with knife or other guns, it will always spawn a snowball, sad


Just write "if player(id,"weapon")==75" near attack hook Anyways I don't think this is what he really wants.

old Re: spawn snowball after throw

knight-
User Off Offline

Quote
user Suprise has written
1
2
3
4
5
6
addhook("hit","snow_attack")
function snow_attack(id,source,weapon)
	if weapon == 75 then
		parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
	end
end

This is better
1
2
3
4
addhook("attack","snow_attack")
function snow_attack(id)
parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
end

But with this if you attack with knife or other guns, it will always spawn a snowball, sad

Thx,but i want it spawn at the place it arrive

old Re: spawn snowball after throw

Happy eyes
User Off Offline

Quote
user knight- has written
user Suprise has written
1
2
3
4
5
6
addhook("hit","snow_attack")
function snow_attack(id,source,weapon)
	if weapon == 75 then
		parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
	end
end

This is better
1
2
3
4
addhook("attack","snow_attack")
function snow_attack(id)
parse("spawnitem 75 "..player(id,"tilex").." "..player(id,"tiley").."")
end

But with this if you attack with knife or other guns, it will always spawn a snowball, sad

Thx,but i want it spawn at the place it arrive


1
2
3
4
5
6
7
8
addhook('projectile','projectile')
function projectile(id,weapon,x,y)
	local x = math.floor(x/32)
	local y = math.floor(y/32)
	if weapon == 75 then
		parse('spawnitem 75 '..x..' '..y)
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview