Thread: Hat system help
View Single Post
  #2  
Old 01-10-2012, 11:32 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by r3ckless View Post
Hello, I'm trying to script part of a hat system. I have the hats, the shops etc. Im now stuck on scripting free hats you can find around the world. Something similar to UN. Below is what I have, it works except for one thing...it doesn't hide after it has been received! Could somebody please give me some tips on this/point me in the right direction for this...

script..
It´s not the securest one. You should look around for more secure ways. Anyway this should work:

PHP Code:
// NPC made by Stowen
function onCreated(){
  
blockagain();
  
setshape(1,32,32);
}

function 
onActionGrab() {
  
clientr.hat3 1;
  
clientr.hats.add("hat3.png");
  
player.chat "You received the Western Hat!";
}

//#CLIENTSIDE
function onPlayerEnters() {
  if (!
clientr.hat3) {
    
setimgpart("hat3.png"9604848);
  }
  else
    
hide();
}

function 
onCreated() {
  if (!
clientr.hat3) {
    
blockagain();
    
setshape(1,32,32);
  }
  else 
dontblock();

__________________
MEEP!

Last edited by callimuc; 01-10-2012 at 11:54 PM..
Reply With Quote