diff --git a/Individual Components/SystemTemplate.rbxm b/Individual Components/SystemTemplate.rbxm index d6d3b12..fc669e1 100644 Binary files a/Individual Components/SystemTemplate.rbxm and b/Individual Components/SystemTemplate.rbxm differ diff --git a/Scripts/SecuritySystem.lua b/Scripts/SecuritySystem.lua index 45f5732..2aa0352 100644 --- a/Scripts/SecuritySystem.lua +++ b/Scripts/SecuritySystem.lua @@ -1,14 +1,31 @@ +local defaultCodes = {"1234"} + +local dataStore = nil local DataStoreService = game:GetService("DataStoreService") -local dataStore = DataStoreService:GetDataStore('securityCodes-' .. script.Parent.dataStoreKey.Value or "XP-99") +dataStoreKey = script.Parent.dataStoreKey.Value +if dataStoreKey ~= "" then + dataStore = DataStoreService:GetDataStore('securityCodes-' .. script.Parent.dataStoreKey.Value or "XP-99") +else + -- Make virtual datastore for offline use + dataStore = { + _data = {}, + GetAsync = function(self, key) + return self._data[key] + end, + SetAsync = function(self, key, value) + self._data[key] = value + end + } +end function setup(parentScript) -- dont touch - version = "v1.2.1" + local version = "v1.2.2" -- codes object, will be swapped for data store later codes = dataStore:GetAsync("codes") if not codes then - codes = {"1234"} + codes = defaultCodes dataStore:SetAsync("codes", codes) end @@ -201,7 +218,11 @@ delay else ux.setLEDs(keypads, "ready", true) ux.setLEDs(keypads, "armed", false) - ux.setDisplays(keypads, "****DISARMED****", " READY TO ARM ") + if not chime then + ux.setDisplays(keypads, "****DISARMED****", " READY TO ARM ") + else + ux.setDisplays(keypads, " DISARMED CHIME ", " READY TO ARM *") + end end elseif armState == 1 then -- We are armed stay ux.setLEDs(keypads, "armed", true) @@ -328,6 +349,7 @@ delay elseif key == "8" then -- If the code used was code 1, and the system is disarmed, Set inputMode to 2 (code change) -- See what index the code is at, if its index 1, its the right code, set mode to 2. do NOT hardcode the code here + print(codes[1] .. " : " .. authedUser) if codes[1] == authedUser then inputMode = 2 else