Code: Select all
{
ACCIONSLOTS [0]
OPENORCLOSED [0] //Open is 1, closed is 0
Spawn[()
{
Console(true);
LowLevel("IsClose");
return 0;
}]
IsClose[()
{
AnimationSpeed(1.50);
if(OPENORCLOSED = 0)
{
if(FastDistance("jugador", 50))
{
if(GetAttribute("Acciones", "jugador") = 0)
{
ACCIONSLOTS = 1;
self.think = "Closed";
return 0;
}
if(GetAttribute("Acciones", "jugador") = 1)
{
ACCIONSLOTS = 2;
self.think = "Closed";
return 0;
}
if(GetAttribute("Acciones", "jugador") = 2)
{
ACCIONSLOTS = 3;
self.think = "Closed";
return 0;
}
if(GetAttribute("Acciones", "jugador") = 3)
{
return 0;
}
}
}
if(OPENORCLOSED = 1)
{
if(FastDistance("jugador", 50))
{
if(GetAttribute("Acciones", "jugador") = 0)
{
ACCIONSLOTS = 1;
self.think = "Open";
return 0;
}
if(GetAttribute("Acciones", "jugador") = 1)
{
ACCIONSLOTS = 2;
self.think = "Open";
return 0;
}
if(GetAttribute("Acciones", "jugador") = 2)
{
ACCIONSLOTS = 3;
self.think = "Open";
return 0;
}
if(GetAttribute("Acciones", "jugador") = 3)
{
return 0;
}
}
}
}]
Closed[()
{
if(FastDistance("jugador", 50) = false)
{
self.think = "IsClose";
return 0;
}
SetTarget("jugador");
SetFOV(179); //Si lo ve, es que es para empujar.
SetAttribute("Acciones", ACCIONSLOTS, "jugador");
if(ACCIONSLOTS = 1)
{
if(IsKeyDown(29))
{
if(self.enemy_vis = true)
{
SetPosition("jugador", self.current_X , self.current_Y, self.current_Z - 8);
Animate("opendoor");
AnimateEntity("Pulldoor", "jugador", true);
if(jugador.animate_at_end)
{
SetAttribute("Accionando", 0, "jugador");
AnimateBlend("opened", 1);
OPENORCLOSED = 1;
Self.think = "Open";
}
}
}
}
}]
Open [()
{
if(FastDistance("jugador", 50) = false)
{
self.think = "IsClose";
return 0;
}
SetTarget("jugador");
SetFOV(179); //Si lo ve, es que es para empujar.
SetAttribute("Acciones", ACCIONSLOTS, "jugador");
if(ACCIONSLOTS = 1)
{
if(IsKeyDown(29))
{
if(self.enemy_vis = true)
{
SetPosition("jugador", self.current_X , self.current_Y, self.current_Z - 8);
Animate("closedoor");
AnimateEntity("Pulldoor", "jugador", true);
if(jugador.animate_at_end)
{
SetAttribute("Accionando", 0, "jugador");
AnimateBlend("closed", 1);
OPENORCLOSED = 0;
Self.think = "Closed";
}
}
}
}
}]
}