Forum

> > CS2D > Scripts > spawn snowball after throw
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch spawn snowball after throw

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt spawn snowball after throw

knight-
User Off Offline

Zitieren
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.

alt Re: spawn snowball after throw

Suprise
BANNED Off Offline

Zitieren
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

alt Re: spawn snowball after throw

Happy eyes
User Off Offline

Zitieren
user Suprise hat geschrieben
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.

alt Re: spawn snowball after throw

knight-
User Off Offline

Zitieren
user Suprise hat geschrieben
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

alt Re: spawn snowball after throw

Happy eyes
User Off Offline

Zitieren
user knight- hat geschrieben
user Suprise hat geschrieben
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht