Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   script help ;D (https://forums.graalonline.com/forums/showthread.php?t=75395)

theHAWKER 07-14-2007 04:10 AM

script help ;D
 
why isn't this working??
PHP Code:

function onCreated(){
this.on = false;
}
function 
onWeaponFired(){
if (
this.on = false){
this.on = true;
}
if (
this.on = true){
this.on = false;
}
}
function 
onCreated(){
setTimer(.1);
}
function 
onTimeout(){
if (
this.on = true){
player.alpha = 50;
}
if (
this.on = false){
player.alpha = 100;
}
setTimer(.1);
} 


JkWhoSaysNi 07-14-2007 04:26 AM

Because you're using = as comparison, you have 2 onCreated's
Also, your script is 10x longer than it needs to be

edit: Why are you even using a timeout?

PHP Code:

function onCreated(){
this.on = false;
}
function 
onWeaponFired(){
this.on = !this.on;
player.alpha = (this.on) ? 50 : 100;
} 



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

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