72 lines
2.1 KiB
Lua
72 lines
2.1 KiB
Lua
-- Simple GaG Loader
|
|
-- ไฟล์สำหรับโหลด SimpleUI.lua
|
|
|
|
-- ตรวจสอบว่าเป็นเกม GaG หรือไม่
|
|
if game.PlaceId ~= 4442272183 then
|
|
warn("This script is only for Grow a Garden (GaG)")
|
|
return
|
|
end
|
|
|
|
-- ป้องกันการรันซ้ำ
|
|
if _G.SimpleGaGLoaded then
|
|
warn("Simple GaG UI is already loaded!")
|
|
return
|
|
end
|
|
_G.SimpleGaGLoaded = true
|
|
|
|
print("Loading Simple GaG UI...")
|
|
|
|
-- โหลด UI ด้วยวิธีต่างๆ
|
|
local success, SimpleUI
|
|
|
|
-- วิธีที่ 1: โหลดจากไฟล์ local (ถ้ามี)
|
|
success, SimpleUI = pcall(function()
|
|
return loadfile("SimpleUI.lua")()
|
|
end)
|
|
|
|
-- วิธีที่ 2: โหลดจาก GitHub หรือ Raw URL (ถ้าต้องการ)
|
|
--[[
|
|
if not success then
|
|
success, SimpleUI = pcall(function()
|
|
return loadstring(game:HttpGet("YOUR_RAW_URL_HERE"))()
|
|
end)
|
|
end
|
|
--]]
|
|
|
|
-- วิธีที่ 3: โหลดจากโค้ดที่ฝังไว้
|
|
if not success then
|
|
success, SimpleUI = pcall(function()
|
|
-- ใส่โค้ด SimpleUI.lua ทั้งหมดที่นี่ถ้าต้องการ
|
|
-- หรือใช้ loadstring กับโค้ดที่เข้ารหัส
|
|
return nil
|
|
end)
|
|
end
|
|
|
|
if success and SimpleUI then
|
|
print("✅ Simple GaG UI loaded successfully!")
|
|
|
|
-- แสดงข้อความต้อนรับ
|
|
game:GetService("StarterGui"):SetCore("SendNotification", {
|
|
Title = "Simple GaG UI",
|
|
Text = "UI loaded successfully! 🌱",
|
|
Duration = 3
|
|
})
|
|
|
|
else
|
|
warn("❌ Failed to load Simple GaG UI")
|
|
|
|
-- แสดงข้อผิดพลาด
|
|
game:GetService("StarterGui"):SetCore("SendNotification", {
|
|
Title = "Simple GaG UI",
|
|
Text = "Failed to load UI ❌",
|
|
Duration = 3
|
|
})
|
|
end
|
|
|
|
-- ฟังก์ชันสำหรับโหลดใหม่
|
|
_G.ReloadSimpleGaG = function()
|
|
_G.SimpleGaGLoaded = false
|
|
loadstring(game:HttpGet("PATH_TO_THIS_LOADER"))()
|
|
end
|
|
|
|
return SimpleUI |