Quote:
Originally Posted by theHAWKER
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.wlevel, this.wx, this.wy);
}
Should work if you upload it to a server. Next time at least explain what you want the code to do :x