forked from Simnation/Main
housing
This commit is contained in:
parent
6d90da2841
commit
b71b47a9fb
169 changed files with 12687 additions and 2932 deletions
|
@ -0,0 +1,47 @@
|
|||
-- Delay between each attempt to open/close the doors corresponding to their state
|
||||
local _scanDelay = 500
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
local office = 0
|
||||
|
||||
-- Search for the current office to open/close the safes doors
|
||||
if Global.FinanceOffices.isInsideOffice1 then
|
||||
office = FinanceOffice1
|
||||
elseif Global.FinanceOffices.isInsideOffice2 then
|
||||
office = FinanceOffice2
|
||||
elseif Global.FinanceOffices.isInsideOffice3 then
|
||||
office = FinanceOffice3
|
||||
elseif Global.FinanceOffices.isInsideOffice4 then
|
||||
office = FinanceOffice4
|
||||
end
|
||||
|
||||
if office ~= 0 then
|
||||
-- Office found, let's check the doors
|
||||
|
||||
-- Check left door
|
||||
doorHandle = office.Safe.GetDoorHandle(office.currentSafeDoors.hashL)
|
||||
|
||||
if doorHandle ~= 0 then
|
||||
if office.Safe.isLeftDoorOpen then
|
||||
office.Safe.SetDoorState("left", true)
|
||||
else
|
||||
office.Safe.SetDoorState("left", false)
|
||||
end
|
||||
end
|
||||
|
||||
-- Check right door
|
||||
doorHandle = office.Safe.GetDoorHandle(office.currentSafeDoors.hashR)
|
||||
|
||||
if doorHandle ~= 0 then
|
||||
if office.Safe.isRightDoorOpen then
|
||||
office.Safe.SetDoorState("right", true)
|
||||
else
|
||||
office.Safe.SetDoorState("right", false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Wait(_scanDelay)
|
||||
end
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue