Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-10-2012, 11:01 PM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
Hat system help

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...

PHP Code:
// NPC made by Stowen

function onCreated(){
  
blockagain();
  
setshape(1,32,32);
}

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

//#CLIENTSIDE

function onPlayerEnters() {
  if (!
clientr.hat3) {
    
with(findimg(200)){
      
image "hat3.png";
      
this.x;
      
this.y;
      
partx 100;
      
party 0;
      
parth 40;
      
partw 45;
    }
  }else 
hide;
}

function 
onCreated(){
  
blockagain();
  
setshape(1,32,32);
}

function 
Hide() {
hide;

__________________

Yep.

Reply With Quote
  #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
  #3  
Old 01-10-2012, 11:38 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by callimuc View Post
Itīs not the securest one. You should look around for more secure ways. Anyway this should work:

PHP Code:
...

  
hide();
}

//#CLIENTSIDE
... 
This is going to hide for everyone until they re-enter the level.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 01-10-2012 at 11:38 PM.. Reason: grammar, spelling, &c.
Reply With Quote
  #4  
Old 01-10-2012, 11:54 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
Oh totally forgot about that. Just checked some GS1->GS2 stuff and missed that one while doing the rest. Fixed the post.
__________________
MEEP!
Reply With Quote
  #5  
Old 01-11-2012, 02:30 AM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
Still the same problem...it still won't hide after being grabbed....It adds the flags and such, but the hat doesnt hide after it is grabbed.

EDIT: Nevermind, I solved my own problem.
__________________

Yep.

Reply With Quote
  #6  
Old 01-11-2012, 01:59 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Renamed the thread to a more suitable title; please see the posting guidelines.
__________________
Skyld
Reply With Quote
  #7  
Old 01-12-2012, 05:55 AM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
Alright, sorry. I'll read that next time.
__________________

Yep.

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.