Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-18-2011, 09:23 PM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
class onActionServerside?

I've made a 'block' script, but I want to set the head of the player as the block so I've been trying out unique ways thus far and this is the way that I've came up with that ought to work. Basically, if I can set temp.stringhead as player.head it ought to get the player's head however I cannot use temp.head serverside and I don't think onActionServerside works either.

PHP Code:
function onCreated(){
  
setHead(temp.stringhead);
}

// don't use this.head, it refers to the object outside of scope

function setHead(temp.head){
  
setimgpart(temp.head0643232);
  
setshape(13232);
  
this.allowed = {"Graal788446"};
}

function 
onActionGrab(){
  if (
player.account in this.allowed && player.chat != NULL){
    
this.OldChat player.chat;
    
this.chat player.chat;
    
this.account player.communityname
  } else if(
this.account != NULL){
    
this.chat "(" "placed by " this.account ")";
    
sleep(3);
    
this.chat this.OldChat;


}

function 
onActionDestroy(){
  if (
player.account in this.allowed){
    
destroy();
  }
}

//#CLIENTSIDE

function onCreated(){
  
temp.stringhead player.head;

this class is really only activated when they try to 'place' a block, so it ought to just get the player.head of the placer
__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???
Reply With Quote
  #2  
Old 09-18-2011, 09:31 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
In your block layer I imagine you have some sort of code like this:

PHP Code:
function onActionServerSide() {
  if (
params[0] == "createblock") {
    
temp.block putnpc2(params[1], params[2], "");
    
temp.block.headblock player.head;
    
temp.block.join("your_block_class");
  }

Then in your class you can use this.headblock as your image name.
__________________
Quote:
Reply With Quote
  #3  
Old 09-18-2011, 09:32 PM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
Thanks FP4! +rep

Edit: Too much rep given to FP4 within a short timespan!
__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???
Reply With Quote
Reply


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 06:54 PM.


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