Thread: Script errors
View Single Post
  #21  
Old 04-08-2008, 02:59 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbkbud View Post
I thought the problem was that it was rejecting any string named message, therefor, it wouldn't let you do x.message ... ?
Actually it only only happens when using findnpc, findplayer, findlevel, actually, any function like object, odd huh?

All these scripts will produce the line
PHP Code:
function onCreated() {
  echo(
findplayer("Chompy").message); // if the player exists or not doesn't matter
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
PHP Code:
function onCreated() {
  echo(
findad("pepsi").message); // doesn't matter if the function exists
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
PHP Code:
function onCreated() {
    echo(
findbirdandpatit().message); // you get the point..
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
Now, the weird thing about it is..

this works:

PHP Code:
function onCreated() {
  
temp.a_b = new TStaticVar();
  
temp.a_b."foo";
  
  
temp."_b";
  
  echo(
makevar("a"@b).c);
}
/*
foo
*/ 
while this doesn't
PHP Code:
function onCreated() {
  
temp.a_b = new TStaticVar();
  
temp.a_b.message "foo";
  
  
temp."_b";
  
  echo(
makevar("a"@b).message);
}
/*
Script compiler output for ChompyTest:
Weapon/GUI-script ChompyTest added/updated by Chompy
*/ 
__________________
Reply With Quote