Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-16-2011, 02:36 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Looking for opinons.

As title says, I'm just looking for opinons on this code. If it's unreadable (mainly), takes too much memory whatever. (So long as it's helpful of course..)

Take note, i might ask questions.

PHP Code:
//#CLIENTSIDE
function onCreated(){
this.boots false;
this.speed 2;
}

function 
onKeyPressed(codekey){
if(
key == "b"){

if(
this.boots == false){

this.boots true;
}

else if(
this.boots == true){

this.boots false;
}

if(
this.boots == false){
player.chat "Boots off!";
}

else if(
this.boots == true){

player.chat "Boots on!";
setTimer(0.05);
}
 }
  }


  function 
onTimeout() {
if (
this.boots == true) { 
  for ( 
temp.key 0key 4key++) { 
                                   
   if(
keydown(key)){ 
    
player.+= vecx (key) * this.speed
    
player.+= vecy (key) * this.speed
                                
  } 
}  
  
setTimer(0.05); 
  }
 } 
Reply With Quote
 


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 09:20 PM.


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