![]() |
Gun Script
my gun can only attack like a sword, and i need to make it so it fires from afar, can someone help me?
__________________________________________________ ________ //#CLIENTSIDE function onCreated() { client.max_m16_ammo = 100; client.m16_ammo= 100; this.m16_on = 0; } function onWeaponFired() { if (this.m16_on = 0) { this.m16_on = 1; if (this.m16_on == 1 && client.m16_ammo > 0) { replaceani("walk", "nightmare_m16_walk"); replaceani("idle", "nightmare_m16_idle"); replaceani("sword", "nightmare_m16_fire"); } else if (this.m16_on == 1 && client.m16_ammo == 0) { replaceani("walk", "nightmare_m16_walk"); replaceani("idle", "nightmare_m16_idle"); replaceani("sword", "nightmare_m16_reload"); } } else if (this.m16_on == 1) { this.m16_on = 0; replaceani("walk", "walk"); replaceani("idle", "idle"); replaceani("sword", "sword"); } } function onKeyPressed(keycode, keychar) { if (this.harpo_on == 1 && keychar == "r") { if (client.harpo_ammo == 0) { setani("nightmare_m16_reload", " "); client.m16_ammo = client.max_m16_ammo; } } if (keychar == "s" && client.m16_ammo > 0) { client.m16_ammo -= 1; setshootparams("damage", 10); temp.shootangle = getangle(vecx(player.dir), vecy(player.dir)); shoot(player.x+vecx(player.dir), player.y+vecy(player.dir), player.z, temp.shootangle, 0, 0, "nightmare_m16_bullet", NULL); } } |
.......... i know half of are stealing it so DONT READ UNLESS U CAN HELP!!!
(or u just wanna chat, thats fine too.) |
Why would anyone want to steal this..?
|
Quote:
You mean you press S and a sword comes up anyway...? and I don't know why someone would steal a script that's BROKEN. |
Also questionable whether you made that or not. Seems to follow a common format :whatever:
|
Seems like sloppy code in general. x_x
|
At least he seems to somewhat understand his objects.
But I cringe at this: Quote:
|
You need to use the shoot() command for a good gun in my opinion, wiki has good documentation on this command, but you could also use showimg with some checks and what not, seems like it might lag. The reason it only attacks like a sword is because your replace the sword ani which is default to only hurt the things in front you, not things that are afar.
|
| All times are GMT +2. The time now is 01:24 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.