Jump to content

HOLA, ME AYUDAN PARA HACER QUE UN PORTON SE ABRA Y SE CIERRE?


Marino_420

Recommended Posts

Sería algo así...

local puerta=createObject(...)
local abierto=false
addCommandHandler("abrir",function(jug,_)
    if not(abierto)then
        local x,y,z=getElementPosition(puerta)
        moveObject(puerta,1500,x,y,z-30)
        abierto=true
    end
end)

addCommandHandler("cerrar",function(jug,_)
    if(abierto)then
        local x,y,z=getElementPosition(puerta)
        moveObject(puerta,1500,x,y,z+30)
        abierto=false
    end
end)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...