From c1c48bf2e6bd9e8fbd78502c05c866684db6960f Mon Sep 17 00:00:00 2001 From: Bitl Date: Sat, 16 Jul 2022 20:06:09 -0700 Subject: [PATCH] Added "Update()" API call. Add better error handling code. --- AddonLoader.lua | 54 ++++++++++++++++---- Addon_Template.lua | 7 ++- ServerClock.lua | 35 +++++++++++++ scripts/batch/github_sync.bat | 1 + scripts/game/2006S-Shaders/CSMPFunctions.lua | 18 +++++++ scripts/game/2006S/CSMPFunctions.lua | 18 +++++++ scripts/game/2007E-Shaders/CSMPFunctions.lua | 18 +++++++ scripts/game/2007E/CSMPFunctions.lua | 18 +++++++ scripts/game/2007M-Shaders/CSMPFunctions.lua | 18 +++++++ scripts/game/2007M/CSMPFunctions.lua | 18 +++++++ scripts/game/2008M/CSMPFunctions.lua | 18 +++++++ scripts/game/2009E-HD/CSMPFunctions.lua | 18 +++++++ scripts/game/2009E/CSMPFunctions.lua | 18 +++++++ scripts/game/2010L/CSMPFunctions.lua | 18 +++++++ scripts/game/2011E/CSMPFunctions.lua | 18 +++++++ scripts/game/2011M/CSMPFunctions.lua | 18 +++++++ 16 files changed, 303 insertions(+), 10 deletions(-) create mode 100644 ServerClock.lua diff --git a/AddonLoader.lua b/AddonLoader.lua index aa09ee2..ea2908b 100644 --- a/AddonLoader.lua +++ b/AddonLoader.lua @@ -1,9 +1,11 @@ -- put script names here -Addons = {"ClientNamePrinter", "ShadersCompatibility"} +Addons = {"ClientNamePrinter", "ShadersCompatibility", "ServerClock"} -- DONT EDIT ANYTHING ELSE BELOW +local CoreScriptName = "AddonLoader" + Scripts = {} function AddScript(name) @@ -23,54 +25,88 @@ for i,v in pairs(Scripts) do if (not success) then print("AddonLoader: Failed to load script: " .. response) else - _G.CSScript_AddModule(Modules) + local success2, response2 = pcall(function() _G.CSScript_AddModule(Modules) end) + if (not success2) then + print("AddonLoader: Failed to add script module: " .. response2) + end end end function PreInit(Script, Client) for i,v in pairs(Modules) do - pcall(function() v:PreInit(Script, Client) end) + local success, response = pcall(function() v:PreInit(Script, Client) end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call PreInit: " .. response) + end end end function PostInit() for i,v in pairs(Modules) do - pcall(function() v:PostInit() end) + local success, response = pcall(function() v:PostInit() end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call PostInit: " .. response) + end + end +end + +function Update() + for i,v in pairs(Modules) do + local success, response = pcall(function() v:Update() end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call Update: " .. response) + end end end function OnLoadCharacter(Player, Appearance) for i,v in pairs(Modules) do - pcall(function() v:OnLoadCharacter(Player, Appearance) end) + local success, response = pcall(function() v:OnLoadCharacter(Player, Appearance) end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call OnLoadCharacter: " .. response) + end end end function OnPlayerAdded(Player) for i,v in pairs(Modules) do - pcall(function() v:OnPlayerAdded(Player) end) + local success, response = pcall(function() v:OnPlayerAdded(Player) end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call OnPlayerAdded: " .. response) + end end end function OnPlayerRemoved(Player) for i,v in pairs(Modules) do - pcall(function() v:OnPlayerRemoved(Player) end) + local success, response = pcall(function() v:OnPlayerRemoved(Player) end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call OnPlayerRemoved: " .. response) + end end end function OnPlayerKicked(Player, Reason) for i,v in pairs(Modules) do - pcall(function() v:OnPlayerKicked(Player, Reason) end) + local success, response = pcall(function() v:OnPlayerKicked(Player, Reason) end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call OnPlayerKicked: " .. response) + end end end function OnPrePlayerKicked(Player, Reason) for i,v in pairs(Modules) do - pcall(function() v:OnPrePlayerKicked(Player, Reason) end) + local success, response = pcall(function() v:OnPrePlayerKicked(Player, Reason) end) + if (not success and not string.find(response, CoreScriptName)) then + print("AddonLoader: Failed to call OnPrePlayerKicked: " .. response) + end end end _G.CSScript_PreInit=PreInit _G.CSScript_PostInit=PostInit +_G.CSScript_Update=Update _G.CSScript_OnLoadCharacter=OnLoadCharacter _G.CSScript_OnPlayerAdded=OnPlayerAdded _G.CSScript_OnPlayerRemoved=OnPlayerRemoved diff --git a/Addon_Template.lua b/Addon_Template.lua index 13a7a08..eceaf04 100644 --- a/Addon_Template.lua +++ b/Addon_Template.lua @@ -14,6 +14,11 @@ end function this:PostInit() end +-- executes every 0.1 seconds. (server, solo, studio) +-- arguments: none +function this:Update() +end + -- executes after a character loads (server, solo, studio) -- arguments: Player - Player getting a character loaded, Appearance - The object containing the appearance values -- notes: in play solo, you may have to respawn once to see any print outputs. @@ -43,7 +48,7 @@ end -- DO NOT REMOVE THIS. this is required to load this addon into the game. function AddModule(t) - print("AddonLoader: Adding " .. v:Name()) + print("AddonLoader: Adding " .. this:Name()) table.insert(t, this) end diff --git a/ServerClock.lua b/ServerClock.lua new file mode 100644 index 0000000..2ca784c --- /dev/null +++ b/ServerClock.lua @@ -0,0 +1,35 @@ +local this = {} +local ScriptName = "N/A" + +function this:Name() + return "Server Clock (Time Since Started)" +end + +function this:PreInit(Script, Client) + ScriptName = Script +end + +function this:PostInit() + if (ScriptName == "Server") then + local ver = Instance.new("IntValue",game.Lighting) + ver.Name = "ServerTicks" + ver.Value = 0 + end +end + +-- executes every 0.1 seconds. (server, solo, studio) +-- arguments: none +function this:Update() + if (ScriptName == "Server") then + game.Lighting.ServerTicks.Value = game.Lighting.ServerTicks.Value + 1 + end +end + +-- DO NOT REMOVE THIS. this is required to load this addon into the game. + +function AddModule(t) + print("AddonLoader: Adding " .. this:Name()) + table.insert(t, this) +end + +_G.CSScript_AddModule=AddModule \ No newline at end of file diff --git a/scripts/batch/github_sync.bat b/scripts/batch/github_sync.bat index e67d9bf..c1238ce 100644 --- a/scripts/batch/github_sync.bat +++ b/scripts/batch/github_sync.bat @@ -144,5 +144,6 @@ XCOPY "%cd%\Novetus\README-AND-CREDITS.TXT" "%dest%" /y XCOPY "%cd%\Novetus\addons\Addon_Template.lua" "%dest%" /y XCOPY "%cd%\Novetus\addons\ClientNamePrinter.lua" "%dest%" /y XCOPY "%cd%\Novetus\addons\ShadersCompatibility.lua" "%dest%" /y +XCOPY "%cd%\Novetus\addons\ServerClock.lua" "%dest%" /y XCOPY "%cd%\Novetus\addons\core\AddonLoader.lua" "%dest%" /y if %debug%==1 pause \ No newline at end of file diff --git a/scripts/game/2006S-Shaders/CSMPFunctions.lua b/scripts/game/2006S-Shaders/CSMPFunctions.lua index 5c2861c..c20707d 100644 --- a/scripts/game/2006S-Shaders/CSMPFunctions.lua +++ b/scripts/game/2006S-Shaders/CSMPFunctions.lua @@ -326,6 +326,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -417,6 +423,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:service("Visit"):setUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -439,6 +451,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2006S-Shaders") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2006S/CSMPFunctions.lua b/scripts/game/2006S/CSMPFunctions.lua index f25b896..2174434 100644 --- a/scripts/game/2006S/CSMPFunctions.lua +++ b/scripts/game/2006S/CSMPFunctions.lua @@ -326,6 +326,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -417,6 +423,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:service("Visit"):setUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -439,6 +451,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2006S") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2007E-Shaders/CSMPFunctions.lua b/scripts/game/2007E-Shaders/CSMPFunctions.lua index d670378..14ad4e1 100644 --- a/scripts/game/2007E-Shaders/CSMPFunctions.lua +++ b/scripts/game/2007E-Shaders/CSMPFunctions.lua @@ -388,6 +388,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,VerifiedScripts,Ticket) @@ -475,6 +481,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:service("Visit"):setUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -497,6 +509,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2007E-Shaders") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2007E/CSMPFunctions.lua b/scripts/game/2007E/CSMPFunctions.lua index d6af650..c312e3f 100644 --- a/scripts/game/2007E/CSMPFunctions.lua +++ b/scripts/game/2007E/CSMPFunctions.lua @@ -388,6 +388,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,VerifiedScripts,Ticket) @@ -475,6 +481,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:service("Visit"):setUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -497,6 +509,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2007E") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2007M-Shaders/CSMPFunctions.lua b/scripts/game/2007M-Shaders/CSMPFunctions.lua index ba5d90b..24d5090 100644 --- a/scripts/game/2007M-Shaders/CSMPFunctions.lua +++ b/scripts/game/2007M-Shaders/CSMPFunctions.lua @@ -448,6 +448,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -533,6 +539,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -555,6 +567,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2007M-Shaders") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2007M/CSMPFunctions.lua b/scripts/game/2007M/CSMPFunctions.lua index 090d377..c8cde72 100644 --- a/scripts/game/2007M/CSMPFunctions.lua +++ b/scripts/game/2007M/CSMPFunctions.lua @@ -448,6 +448,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -533,6 +539,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -555,6 +567,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2007M") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2008M/CSMPFunctions.lua b/scripts/game/2008M/CSMPFunctions.lua index 12dca18..095b613 100644 --- a/scripts/game/2008M/CSMPFunctions.lua +++ b/scripts/game/2008M/CSMPFunctions.lua @@ -564,6 +564,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:Stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -652,6 +658,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -674,6 +686,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2008M") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2009E-HD/CSMPFunctions.lua b/scripts/game/2009E-HD/CSMPFunctions.lua index 8b46a1e..ec70627 100644 --- a/scripts/game/2009E-HD/CSMPFunctions.lua +++ b/scripts/game/2009E-HD/CSMPFunctions.lua @@ -645,6 +645,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:Stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -746,6 +752,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -768,6 +780,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2009E-HD") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2009E/CSMPFunctions.lua b/scripts/game/2009E/CSMPFunctions.lua index ddeecf9..a171848 100644 --- a/scripts/game/2009E/CSMPFunctions.lua +++ b/scripts/game/2009E/CSMPFunctions.lua @@ -645,6 +645,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Server.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() Server:Stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -746,6 +752,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, LoadCharacterNew(newWaitForChild(plr,"Appearance"),plr.Character,false) game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -768,6 +780,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2009E") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2010L/CSMPFunctions.lua b/scripts/game/2010L/CSMPFunctions.lua index 3ce02bc..f5ff65d 100644 --- a/scripts/game/2010L/CSMPFunctions.lua +++ b/scripts/game/2010L/CSMPFunctions.lua @@ -648,6 +648,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti NetworkServer.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() NetworkServer:Stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,Ticket) @@ -771,6 +777,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, game.StarterGui.Health:clone().Parent = plr.PlayerGui game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -793,6 +805,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2010L") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2011E/CSMPFunctions.lua b/scripts/game/2011E/CSMPFunctions.lua index 0f5d090..9e115bb 100644 --- a/scripts/game/2011E/CSMPFunctions.lua +++ b/scripts/game/2011E/CSMPFunctions.lua @@ -672,6 +672,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti NetworkServer.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() NetworkServer:Stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,ValidatedScripts,Ticket) @@ -811,6 +817,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -833,6 +845,12 @@ function CSStudio() pcall(function() dofile("rbxasset://..//..//..//addons//core//AddonLoader.lua") end) pcall(function() _G.CSScript_PreInit("Studio", "2011E") end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer diff --git a/scripts/game/2011M/CSMPFunctions.lua b/scripts/game/2011M/CSMPFunctions.lua index ae78b6a..8ade293 100644 --- a/scripts/game/2011M/CSMPFunctions.lua +++ b/scripts/game/2011M/CSMPFunctions.lua @@ -678,6 +678,12 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti NetworkServer.IncommingConnection:connect(IncommingConnection) pcall(function() game.Close:connect(function() NetworkServer:Stop() end) end) pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end function CSConnect(UserID,ServerIP,ServerPort,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID,LeftArmColorID,RightArmColorID,LeftLegColorID,RightLegColorID,TShirtID,ShirtID,PantsID,FaceID,HeadID,IconType,ItemID,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Tripcode,ValidatedScripts,NewGUI,Ticket) @@ -824,6 +830,12 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") game:GetService("Visit"):SetUploadUrl("") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) while true do wait(0.001) if (game.Lighting:findFirstChild("DisableRespawns") == nil) then @@ -854,6 +866,12 @@ function CSStudio(NewGUI) end) dofile("rbxasset://scripts\\cores\\StarterScript.lua") pcall(function() _G.CSScript_PostInit() end) + coroutine.resume(coroutine.create(function() + while true do + wait(0.1) + pcall(function() _G.CSScript_Update() end) + end + end)) end _G.CSServer=CSServer