Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #22  
Old 05-03-2009, 12:41 PM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
onKeyPressed is called on default. Basically all of the event if's were converted to "function onEvent", such as "onPlayerTouchsMe", "onCreated", and "onPlayerEnters". There's no need for the if (keypressed) statement.
Ok, sorry to ask this again, but I am still having problems with this.. I am trying to use the GS2 solution and it's not working (I'm probably doing it wrong.)

Here is what I got..

PHP Code:
function onKeyPressed(codekeychar) {
  if (
key == "i") {
    
temp.img findImg(209);
    
img.visible = ! img.visible;
  }

I have a function doing showimg 209, and trying to use the code snippet you suggested on key i, the image remains shown, and is not hid, as expected.

Is there a way in GS1 to do this?

PHP Code:
if (keypressed) {
   if (
strequals(#p(1),I)){
      
if (img 209 is visible){
         
hideimg 209;
      } else {
         
showimg 209,file,x,y;
      }
   }

__________________
*Don't let the door hit you on the way out.*

Last edited by Raelyn; 05-03-2009 at 02:05 PM..
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:50 PM.


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