-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMainScript.lua
59 lines (56 loc) · 2.17 KB
/
MainScript.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
-- credit to xylex (ty for isfile fix?)
repeat task.wait() until game:IsLoaded()
local cloneref = cloneref or function(obj)
return obj
end
local httpService = cloneref(game.GetService(game, 'HttpService'))
function githubRequest(scripturl)
return game:HttpGet('https://raw.githubusercontent.com/NTDCore/NightbedForRoblox/'..httpService:JSONDecode(game:HttpGet('https://api.github.com/repos/NTDCore/nightbedForRoblox/commits'))[1].sha..'/'..scripturl, true)
end
local isfile = isfile or function(path)
local suc, res = pcall(function() return readfile(path) end)
return suc and res ~= nil
end
local nightbedStore = shared.NBStore
local kavo
kavo = nightbedStore['GuiLibrary'].Kavo
shared.kavogui = kavo
local win = kavo:CreateWindow({
['Title'] = 'Nightbed v'..shared.NBService['Version'],
['Theme'] = (shared.CustomTheme and shared.SetCustomTheme or 'Luna'),
['proj'] = 'nightbed'
})
local Tabs = {
['Combat'] = win.CreateTab('Combat'),
['Blatant'] = win.CreateTab('Blatant'),
['Render'] = win.CreateTab('Render'),
['Utility'] = win.CreateTab('Utility'),
['World'] = win.CreateTab('World')
}
shared.Tabs = Tabs
local cloneref = cloneref or function(obj) return obj end
local playersService = cloneref(game:GetService('Players'))
local lplr = playersService.LocalPlayer
local httpService = cloneref(game:GetService('HttpService'))
local starterUI = cloneref(game:GetService('StarterGui'))
local nightbedData
loadstring(githubRequest('Universal.lua'))()
task.spawn(function()
nightbedData = httpService:JSONDecode(game:HttpGet('https://raw.githubusercontent.com/NTDCore/NightbedForRoblox/'..httpService:JSONDecode(game:HttpGet('https://api.github.com/repos/NTDCore/nightbedForRoblox/commits'))[1].sha..'/Core/data.json', true))
for i,v in nightbedData.Blacklist do
if tonumber(v) == lplr.UserId then
lplr:Kick(tostring(v[lplr.UserId].Reason))
end
end
local nbAnnouncement = nightbedData.Announcement
if nbAnnouncement.Activate then
repeat
starterUI:SetCore('SendNotification', {
Title = 'Nightbed',
Text = tostring(nbAnnouncement.Message),
Duration = tonumber(nbAnnouncement.Wait)
})
task.wait(tonumber(nbAnnouncement.Wait))
until (not nbAnnouncement.Activate)
end
end)