From 8add907b5ad3bd8353bdde92ca53f6ed251ec019 Mon Sep 17 00:00:00 2001 From: Cald-fan <46916205+Cald-fan@users.noreply.github.com> Date: Tue, 23 Feb 2021 20:53:38 -0600 Subject: [PATCH] Update WebPanel.lua fixed my broke if statement. added wait for when server reboots so the server can load everything before a server connects added WebPanel_Initiated Variable --- WebPanel.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/WebPanel.lua b/WebPanel.lua index ff8d58c6c2..f8539f2cac 100644 --- a/WebPanel.lua +++ b/WebPanel.lua @@ -10,7 +10,7 @@ return function(Vargs) local server = Vargs.Server; local service = Vargs.Service; - + local init = true local HTTP = service.HttpService local Encode = server.Functions.Base64Encode @@ -224,15 +224,18 @@ return function(Vargs) if init then server.Logs:AddLog("Script", "WebPanel Initialization Complete") + server.Variables.WebPanel_Initiated = true init = false end else local code, msg = res.StatusCode, res.StatusMessage - - if code ~= 520 or code ~= 524 then + + if code ~= 520 and code ~= 524 then server.Logs:AddLog("Script", "WebPanel Polling Error: "..msg.." ("..code..")") server.Logs:AddLog("Errors", "WebPanel Polling Error: "..msg.." ("..code..")") break + elseif code == 520 then + wait(5) --After the server restarts we want to make sure that it has time to inititate everything end end wait()