View Single Post
  #1  
Old 11-05-2009, 11:17 AM
Liberated Liberated is offline
not doing alot
Liberated's Avatar
Join Date: Feb 2008
Posts: 1,366
Liberated has a spectacular aura about
gunscript: Yeah i know how unoriginal

Okay so im working on a gunscript.

PHP Code:
//#CLIENTSIDE

function onWeaponFired()
{
  
shoot(player.1.5 vecx(player.dir), player.vecy(player.dir), player.z, (playerdir 1) * pi 2NULLNULL"era_bulletfx"NULL);
  
setani("firegani"NULL);
  
freezeplayer(0.5);
  
}
function 
onActionProjectile()
{
   
player.hearts -= 2;

I don't know what im doing wrong, i don't really understand the shoot command yet, but it's not showing the bullet flying.
Oh and, sometimes if i shoot while walking and shoot again i hurt myself :s
as for this one.
PHP Code:
//#CLIENTSIDE
function onKeyPressed()
{
  
temp.equip 1;
  if (
keydown(5))
  {
    if(
temp.equip == 1)
    {
      
temp.equip 0;
      
setani("gunequip"NULL);
      
sleep(1);
      
setani("gunidle"NULL);
    } 
    else
    {
      
temp.equip 1;
      
setani("idle"NULL);
    }
  }
}
function 
onWeaponFired()
{
  if(
temp.equip == 0)
  {
    
shoot(player.1.5 vecx(player.dir), player.vecy(player.dir), player.z, (playerdir 1) * pi 2NULLNULL"era_bulletfx"NULL);
    
setani("gunidlegani"NULL);
    
freezeplayer(0.1);
  }
}
function 
onActionProjectile()
{
   
player.hearts -= 2;

I need to figure out if the player is moving or standing still, to add a walking/idle gani to it, but i have no idea how to check it, also, the ganis don't seem to be working on this one, i haven't made any gani's myself yet, so i used those of a server, and i even uploaded them to testbed, but they still don't work.

i would've checked the wiki for the shoot command, but as we all know that's temporarily down.

I myself think i need a timeout function that will constantly check if the player is moving or standing still
__________________
Quote:
Originally Posted by Tigairius View Post
I promise when I get rich I'll send you an iPhone. I'll send everyone an iPhone.

Last edited by Liberated; 11-05-2009 at 11:35 AM..
Reply With Quote