Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Door-Script (https://forums.graalonline.com/forums/showthread.php?t=134257081)

OiRodgar 11-26-2009 05:39 PM

Door-Script
 
Hi there! I'm trying to script a door that only the account OiRodgar can open with the command /open. Tried a few things but it won't work...

PHP Code:

// NPC made by unknown
//#CLIENTSIDE
function onCreated()

{
  
this.account="OiRodgar";
}
{
  if(
player.account==this.account)
    {
    function 
onPlayerchats()

    {
      if(
player.chat=="/open")

      {
        
hide();
      }
    }
  }



Deas_Voice 11-26-2009 05:47 PM

did u pay attention of what rc 'errors' told you?

the thing that is wrong with your script is that, u probably, by mistake, draged "function onPlayerchats()
" down a few lines down.

DustyPorViva 11-26-2009 05:49 PM

PHP Code:

// NPC made by unknown
//#CLIENTSIDE
function onCreated() {
  
this.access "OiRodgar";
}

function 
onPlayerchats() {
  if(
player.chat == "/open" && player.account == this.access) {
    
hide();
  }



OiRodgar 11-26-2009 05:54 PM

Quote:

Originally Posted by DustyPorViva (Post 1540600)
PHP Code:

// NPC made by unknown
//#CLIENTSIDE
function onCreated() {
  
this.access "OiRodgar";
}

function 
onPlayerchats() {
  if(
player.chat == "/open" && player.account == this.access) {
    
hide();
  }



Ah, thank you, now I understand. By the way, thanks for the help in the other thread.


All times are GMT +2. The time now is 09:11 PM.

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