Thread: Hat Weapon
View Single Post
  #2  
Old 08-12-2010, 11:24 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by iSlayer View Post
Hi all, I'm trying to make a simple NPC when player fires it, it checks if the player has tht hat on, if he does it sets the hat to hat.png, if not it sets the players hat to the hat filename, someone please help me, this is what ive got so far

PHP Code:
//#CLIENTSIDE

function onWeaponFired()
{
  {
  if (
player.attr[1] = "ds-gasmask.png")
  
player.attr[1] = "hat.png"
  }
  else
  {
  
player.attr[1] = "ds-gasmask.png";
  }

Thanks!
Your brackets are off.

PHP Code:
//#CLIENTSIDE
function onWeaponFired()
{
  if (
player.attr[1] = "ds-gasmask.png") {
  
player.attr[1] = "hat.png"
}
  else if (
player.attr[1] = "hat.png") {
  
player.attr[1] = "ds-gasmask.png'";

I think that'll work.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote