I know this has been done many times via Trigger. But I discovered a long time ago that it's also possible in Lua, and decided to share it because it was part of an old mod of mine which I never really told people about(just a small mod for fun).
So open Trigger.img which is in the DAT folder, all in the Bully folder. Open it in Notepad++ which can be downloaded here:
https://notepad-plus-plus.org/download/v6.7.9.2.htmlnow that you have it open, press CTRL + F, and search either
islocked true or
"dt_.
either one works, but I use "dt_ more.
then should be some more information, then you should see the triggername strings (eg. TRIGGERNAME "DT_tschool_RoofDoor").
In your LUA script, somewhere that will only run once, such as MissionSetup, Main etc. put AreaSetDoorLocked(triggerName, false)
replace
triggerName with the triggername you chose from Trigger.img.
For example. if I wanted to use this one:
TRIGGERNAME "DT_ischool_Art"
AREACODE 2
POSITION -671.481995, -291.666992, 5.480890
YAWPITCHROLL 0.000000, 0.000000, 0.000000
YAW 0.000037
ZHEIGHT 1.000000
ISMISSIONSPECIFIC FALSE
ISLOCKED TRUE
AMBIENT 255, 255, 255
USETIMECYCLE FALSE
HASPOPULATIONDATA 0
FORCEPOPREAD FALSE
HASAMBIENTVEHICLEDATA 0
FORCEVEHREAD FALSE
i would do: AreaSetDoorLocked("DT_ischool_Art", false)
to lock them up again, change the false to true.
interior names(From Rambo7):
AreaSetDoorLocked("DT_tschool_AutoShopL", false) --Autoshop
AreaSetDoorLocked("DT_ischool_Door01", false) --Chemistry Class
AreaSetDoorLocked("DT_ischool_Classroom", false) --English/Maths/Geology Class
AreaSetDoorLocked("DT_ischool_Art", false) --Art Class
AreaSetDoorLocked("DT_ISCHOOL_BIO", false) --Biology Class
AreaSetDoorLocked("DT_ischool_Staff", false) --Staff Room
AreaSetDoorLocked("DT_ischool_AuditorBalc", false) -- Auditorium Balcony 2nd floor
AreaSetDoorLocked("DT_ischool_AuditorDoorL", false) -- Auditorium 1st floor