![]() |
Helpo Changeo
Ok,
I have a npc that you become and can shoot with by using keydown, but when its out ammo the thing want stop shooting and i do have the if (playerbombs<0) and playerbomb-=1 in there but how would i disable the D jkey if the player bombs = 0?? -Knight_Vincent |
just use disabledefweapons and then use your keydown
|
Like This?
if (playerbombs==0) { if (keydown(4))disableweapons; :confused: -Knight_Vincent |
no you would disable the keys when the player entered the level/fired the NPC (depending on which way youve made the game) then do the keydown stuff
|
Um,
But how do i disable a key is what i mean. -Knight_Vincent |
well supposing you want it to do it when you fire the NPC do it like this
NPC Code: just put in the keydown 4 bit a thing to check the player still has ammo or whatever it uses |
Ok,
I want it so if i run outa ammo keydown 4 is dissabled for 15 secounds while it recharges... -Knight_Vincent |
NPC Code: or something to that effect. You can replace the "play nexpage.wav" to anything you want to take up time while it recharges. |
Hmmm,
Well that works to regain the ammo and lose the ammo but it still does not disable keydown 4 for 15 secs -Knight_Vincent |
how about ...
NPC Code: You can't really disable it, only make it so it doesn't do anything when pressed. |
Ok,
But im not useing a gani... I haved tryed, if (keydown(4)&&playerbombs==0) setplayerprop #c, ...Recharging...; timeout=15; if (timeout) playerbombs=99; setplayerprop #c, ...Recharged...; if (keydown(4)&&playerbombs<0) function shoot() { play effect1.wav; shots[bllt]=ship[0]+addx; shots[bllt+1]=ship[1]+addy; shots[bllt+2]=addx; shots[bllt+3]=addy; if (bllt<maxshots*4) {bllt+=4}else{ bllt=0; } } but all it does is make a lagy coppie of the ship and still lets you shoot wile it reloads :(. Im stumped :(. -Knight_Vincent |
Quote:
NPC Code: There, that should work |
Hmm,
Well at least its not cloning the ship now but... the bombs go from 99 to 98 back to 99... they wont drop any further. :( -Knight_Vincent |
| All times are GMT +2. The time now is 12:33 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.