-- Set Physics on and always active=no Name the first lift and set the ifused to the same name. Set Physics weight to 0. -- Need to add this to global.lua above the constants. playerOnLiftMode = "" lift_mode = {} lift_originalY = {} function lift_init(e) lift_mode[e] = "floor" lift_originalY[e] = -9999 playerOnLiftMode= "Up" end function lift_main(e) speed = 40 -- Set the object number here of the lift. if e == 1 then speed = 200 end if lift_originalY[e] == -9999 then lift_originalY[e] = g_Entity[e]['y'] end if lift_mode[e] == "floor" then if GetPlayerDistance(e) < 60 then lift_mode[e] = "up" playerOnLiftMode = "up" CollisionOff(e) end end if lift_mode[e] == "up" then MoveUp(e,speed) TransportToIfUsed(e) if playerOnLiftMode =="stop" then lift_mode[e] = "stop" CollisionOn(e) end end if lift_mode[e] == "stop" then if GetPlayerDistance(e) > 100 then lift_mode[e] = "ceiling" playerOnLiftMode = "" end end ---------------------------------------------------------------- if lift_mode[e] == "ceiling" then if GetPlayerDistance(e) < 60 then lift_mode[e] = "down" playerOnLiftMode = "down" CollisionOff(e) end end if lift_mode[e] == "down" then MoveUp(e,-speed) TransportToIfUsed(e) if lift_originalY[e] > g_Entity[e]['y'] then lift_mode[e] = "stopfloor" SetPosition(e,g_Entity[e] ['x'],lift_originalY[e],g_Entity[e]['z']) end end if lift_mode[e] == "stopfloor" then if GetPlayerDistance(e) > 100 then lift_mode[e] = "floor" playerOnLiftMode = "" end end end