View Single Post
  #2  
Old 08-15-2011, 01:16 AM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by blackbeltben View Post
I have this script in a class with a npc joining it in the level. I am making a character custimization screen, but for some reason, when you click, it is not triggering the server and setting the clientr change. Ive tried clientr.race, player.clientr.race, this.player.clientr.race, just about everything. Ive even tried it with other variables changing that increase numbers. With that, Ive came to the conclusion that it is not triggering the server. Please help

PHP Code:
function onActionServerside() {
 if (
params[0] == "Change")
{
 
player.clientr.race "Human";
}
}

//#CLIENTSIDE
function onCreated()
{
 
setimg("runa_races_human.png");
 }
 
 function 
onMouseDown()
{
 if (
mousescreenx in |this.x,this.x+810| &&
     
mousescreeny in |this.y,this.y+211|)
          {
          
play("runa_click");
          
triggerserver("weapon"this.name"Change");
          }
 } 
I believe this is due to a mix up in level coordinates and screen coordinates, mousescreenx and mousescreeny are the positions of your mouse in pixels relevant to your screen, whereas this.x and this.y are the level coordinates measured in tiles (1 tile is 16 pixels in height and width).

Try this?:

PHP Code:
if (mousex in |this.x,this.x+widthintiles| &&
     
mousey in |this.y,this.y+heightintiles|)
          { 
Reply With Quote