View Single Post
  #5  
Old 07-13-2007, 07:59 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by theHAWKER View Post
i think he wants to warp a "block" to a level...
Doubt it. It's doing player.setlevel2() : not actually making the NPC warp.

PHP Code:
if (playertouchsme){
setlevel2 #s(this.blocklevel),#s(this.blockx),#s(this.blocky );
}
if (
playerchats && strequals(#c,/blockwarp) && strequals(#a,bscharff)){
tokenize #c;
#t(1) = this.blocklevel;
#t(2) = this.blockx;
#t(3) = this.blocky;

This one requires you to say exactly /blockwarp but then it tokenizes the chat and then sets the token values to local variables. For the second one: I have no clue :x

Do you want to be able to say a location then be warped there when you touch the block? If so

PHP Code:
function onPlayerChats()
{
  if (
player.account == "youraccounthere")
  {
    if (
player.chat.starts("/blockwarp"))
    {
      
temp.toks player.chat.tokenize();
      
this.wlevel temp.toks[1];
      
this.wx temp.toks[2];
      
this.wy temp.toks[3];
    }
  }
}

function 
onPlayerTouchsMe()
{
  
player.setlevel2(this.wlevelthis.wxthis.wy);

Should work if you upload it to a server. Next time at least explain what you want the code to do :x
Reply With Quote