Quote:
Originally Posted by Cherrykao
Yadda yadda yadda
|
Well first of all, You need to define the variable on the client. Something like "client.vUnderRoof = false/true" will work fine.
Next, You need to do a loop to enable the code to detect the variable.
PHP Code:
timeout = 0.05;
if (timeout)
{
if (client.vUnderRoof == true) {
vRoofI();
}
if (client.vUnderRoof == false) {
vRoofV();
}
}
_______
Quote:
|
Originally Posted by DustyPorViva
Well that's a bad way to do it.
You should probably check the players.x/y in a timeout and when the player enters the coordinates of the roof, transparent, otherwise, return to normal.
|
I agree. Cherry, Why not check if the player's X and Y isn't in the NPC to undo it?
PHP Code:
// In timeout code
this.w = 4; // How many tiles the roof takes up, Horizontally
this.h = 4; // How many tiles the roof takes up, Vertically
if (!(playerx in |this.x, (this.x+this.w)|) && !(playery in |this.y, (this.y+this.h)|)
{
// Code to make roof opaque
} else {
// Code to make roof translucent
}