View Single Post
  #1  
Old 05-11-2007, 11:32 PM
Cherrykao Cherrykao is offline
Banned
Join Date: Apr 2007
Posts: 37
Cherrykao is on a distinguished road
making roof semi-transparent

I'm having some trouble getting my scripts to work properly online. It works good offline on the editor.

Basically when you enter a house, the roof turns semi-transparent and then when you exit the house through the door, the roof turns back to normal.

Here's my code for the roof NPC:

NPC Code:

//#CLIENTSIDE
//function onCreated() {
if (created) {
setimg roof.gif;
dontblock;
drawoverplayer;
vRoofV();
vUnderRoof = false;
}

//function onPlayerTouchsMe() {
if (playertouchsme) {
vUnderRoof = true;
}

if (vUnderRoof == true) {
vRoofI();
}
if (vUnderRoof == false) {
vRoofV();
}

// Makes roof transparent
function vRoofI() {
setcoloreffect 1,1,1,0.22;
drawaslight;
}

// Puts roof back to normal
function vRoofV() {
setcoloreffect 1,1,1,1;
//drawaslight;
}

timeout = 0.05;



When someone walks out through the door, the "vUnderRoof" flag is set back to false by touching a grass NPC as they walk out through the door:

NPC Code:

if (created) {
setimg vivendi_h10grass.png;
drawunderplayer;
dontblock;
//vUnderRoof = false;
}

if (playertouchsme) {
vUnderRoof = false;
}

timeout = 0.05;

Reply With Quote