Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------------------------------------
- -- Epix Inc. Server Suite --
- ----------------------------------------------------------------------------------------
- -- Epix Incorporated. Not Everything is so Black and White. --
- ----------------------------------------------------------------------------------------
- local set=require(script.Settings) --This is where to grab settings from.
- --Settings can be found in the Settings ModuleScript parented to this!
- --http://prntscr.com/5n9fv5
- --[[
- --__________________________________________________________________________________--
- --__________________________________________________________________________________--
- --__________________________________________________________________________________--
- --__________________________________________________________________________________--
- -- --
- ___________ .__ .___
- \_ _____/_____ |__|__ ___ | | ____ ____
- | __)_\____ \| \ \/ / | |/ \_/ ___\
- | \ |_> > |> < | | | \ \___
- /_______ / __/|__/__/\_ \ |___|___| /\___ > /\
- \/|__| \/ \/ \/ \/
- --------------------------------------------------------
- Epix Incorporated. Not Everything is so Black and White.
- --------------------------------------------------------
- _ __ _ _ _ _
- | |/ /___| | |_ __ _ __| |_ _ _ ___ _ __| |_ ___
- | ' </ _ \ | _/ _` (_-< _| '_/ _ \ '_ \ ' \/ -_)
- |_|\_\___/_|\__\__,_/__/\__|_| \___/ .__/_||_\___|
- |_|
- ______ ______ ______ __ ______ ______ ______ ______ __ ______
- /\ ___\/\ ___\/\ ___\/\ \ /\ ___\/\ == \/\ __ \/\__ _/\ \/\ ___\
- \ \___ \ \ \___\ \ __\\ \ \___\ \ __\\ \ __<\ \ __ \/_/\ \\ \ \ \___ \
- \/\_____\ \_____\ \_____\ \_____\ \_____\ \_\ \_\ \_\ \_\ \ \_\\ \_\/\_____\
- \/_____/\/_____/\/_____/\/_____/\/_____/\/_/ /_/\/_/\/_/ \/_/ \/_/\/_____/
- --__________________________________________________________________________________--
- --__________________________________________________________________________________-- --
- --__________________________________________________________________________________--
- --__________________________________________________________________________________--
- -- -- ]]
- --------------------------------------------------------------------------------------
- --##################################################################################--
- --##[ WARNING: Changing anything below could result errors and break the script! ]##--
- --##################################################################################--
- --#############[ DO NOT MODIFY UNLESS YOU KNOW WHAT YOU ARE DOING! ]################--
- --#################[ I WILL NOT HELP YOU IF YOU BREAK SOMETHING! ]##################--
- --##################################################################################--
- --------------------------------------------------------------------------------------
- --__________________________________________________________________________________--
- --__________________________________________________________________________________-- --
- --__________________________________________________________________________________--
- --__________________________________________________________________________________--
- -- -- --
- set.Debug=false --//DEBUG
- --[ Check for Updates ]--
- function MainScriptFunction()
- if not set.Debug then
- script.Parent=game:service('ServerScriptService')
- end
- local updateCode=script:FindFirstChild("UPDATE_CODE_")
- if (updateCode and _G[updateCode.Value]) or _G['Epix Inc. Server Suite Update'] then
- local updateTable=_G['Epix Inc. Server Suite Update']
- if updateCode then
- updateTable=_G[updateCode.Value]
- end
- local updated,failed=ypcall(function()
- print('AutoUpdate: Grabbing update data...')
- for i,v in pairs(updateTable) do set[i]=v updateTable[i]=nil end
- _G['Epix Inc. Server Suite Update']=nil
- if updateCode then
- _G[updateCode.Value]=nil
- updateCode:Destroy()
- end
- end)
- if failed then
- print(script.Name..': AutoUpdate: Update Failed.')
- print('Please contact Sceleratis as this may be a bug.')
- print('Error: '..failed)
- print('If this error persist please check your settings. If needed disable AutoUpdate until the issue is solved.')
- end
- end
- local Plugins={}
- for i,v in pairs(script['Plugins']:children()) do
- table.insert(Plugins,v)
- end
- if set.Debug then
- print("~=! DEBUG MODE !=~")
- set.HelpGui=false
- require(script.Parent:FindFirstChild("MainModule"))(set,Plugins)
- else
- require(set.MainModuleID)(set,Plugins)
- end
- end
- set.RunTheScript=function()
- local yes,no=ypcall(MainScriptFunction)
- if no then
- local h=Instance.new('Hint',workspace)
- h.Text=no print(no)
- end
- end
- local ok,no=ypcall(function() local k=game:GetService('InsertService'):LoadAsset(set.LoaderID) if k then k:Destroy() end end)
- if set['AutoUpdate'] and ok then
- local k,n=ypcall(function()
- local news=game:GetService('InsertService'):LoadAsset(set.LoaderID):children()[1]
- local found=news.Version.Value
- local current=script.Version.Value
- print('Current version: '..current..' | Found version: '..found)
- if found>current then
- print('Updating...')
- local updateCode = Instance.new("StringValue",news)
- updateCode.Name="UPDATE_CODE_"
- updateCode.Value=math.random()..math.random()
- _G[updateCode.Value]=set
- news['Plugins']:Destroy()
- script['Plugins']:clone().Parent=news
- news.Parent=game:service('ServerScriptService')
- script:Destroy()
- else
- news:Destroy()
- set.RunTheScript()
- end
- end)
- if not k or n then
- print('AutoUpdate Broke: '..n..' | Skipping update')
- set.RunTheScript()
- end
- else
- print("AutoUpdate is Disabled")
- set.RunTheScript()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement