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.head, 0, 64, 32, 32);
setshape(1, 32, 32);
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