English spawn snowball after throw

4 replies
Goto Page
To the start Previous 1 Next To the start
28.08.12 03:44:15 pm
Up
knight-
User
Offline Off
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.
28.08.12 03:58:16 pm
Up
Suprise
BANNED
Offline Off
Code:
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
Code:
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
28.08.12 04:45:18 pm
Up
Happy eyes
User
Offline Off
user Suprise has written:
Code:
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
Code:
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.
28.08.12 04:46:32 pm
Up
knight-
User
Offline Off
user Suprise has written:
Code:
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
Code:
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
28.08.12 04:48:19 pm
Up
Happy eyes
User
Offline Off
user knight- has written:
user Suprise has written:
Code:
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
Code:
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


Code:
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