I'm working on warping a car from one point to another after they leave the car, but for some reason, the NPC will successfully warp to the point I'd like it to warp to, but because the NPC is hidden after the player gets in the car, using show() to make it visible again will not work, and the NPC remains invisible.
Here's a condensed version of what I'm doing.
Class Script - Joined to the car
PHP Code:
function onCreated() {
this.setshape(1, 3 * 16, 3 * 16);
}
function onActionGrab() {
if (player.client.incar != true && player.account == this.owner) {
player.client.incar = true;
player.client.carlevel = this.level.name;
player.client.carid = this.id;
//Hide the car
this.hide();
}
}
/*Called when the player leaves the car, and is triggered from a
control weapon. The car is warped to the correct position, but
the car still remains hidden, and using show() will not show it*/
public function outOfCar() {
//Attempt to show the car
this.show();
}
Weapon Script - Warping process
PHP Code:
function onActionServerside() {
switch(params[0]) {
case "getoutofcar": {
temp.car_level = findlevel(client.carlevel);
for (ln : temp.car_level.npcs) {
if (ln.id == player.client.carid) {
ln.warpto(player.level.name, player.y, player.y);
//Trigger the attempt to show the car
ln.outOfCar();
}
}
break;
}
}
}
//#CLIENTSIDE
function leaveCar() {
triggerserver("gui", name, "getoutofcar");
}
Does anybody have any ideas?