Skip to content

Commit 655b51e

Browse files
authored
Create Main.lua
1 parent 75aa71a commit 655b51e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Main.lua

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
-- Main.lua - NgNhDuc Hub loader
2+
-- Place at: https://raw.githubusercontent.com/<GITHUB_USERNAME>/NgNhDuc/refs/heads/main/Main.lua
3+
4+
local _ENV = (getgenv and getgenv()) or getrenv() or getfenv()
5+
local CURRENT_VERSION = _ENV.Version or "V1"
6+
7+
local Versions = {
8+
V1 = "https://raw.githubusercontent.com/NgNhDuc/NgNhDuc/refs/heads/main/Version/V1.lua"
9+
}
10+
11+
local url = Versions[CURRENT_VERSION]
12+
if not url then
13+
warn("[NgNhDuc Hub] Invalid version: " .. tostring(CURRENT_VERSION))
14+
return
15+
end
16+
17+
print("[NgNhDuc Hub] Loading version:", CURRENT_VERSION)
18+
19+
local ok, src = pcall(function() return game:HttpGet(url) end)
20+
if not ok then
21+
warn("[NgNhDuc Hub] Failed to download version script:", src)
22+
return
23+
end
24+
25+
local success, err = pcall(loadstring(src))
26+
if not success then
27+
warn("[NgNhDuc Hub] Error running version script:", err)
28+
else
29+
print("[NgNhDuc Hub] Version loaded successfully!")
30+
end

0 commit comments

Comments
 (0)