Repository navigation
Expand file tree
/
Copy pathALL-script
More file actions
394 lines (343 loc) · 17.3 KB
/
Copy pathALL-script
File metadata and controls
394 lines (343 loc) · 17.3 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
-- ========================================================
-- ค่ายสุรินทร์หยินหยาง - Ultimate Delta Script Hub + Save System
-- ========================================================
-- โหลดไลบรารี WindUI
local _version = "1.6.66"
local WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/download/" .. _version .. "/main.lua"))()
-- สร้างหน้าต่างหลัก (Window)
local Window = WindUI:CreateWindow({
Title = "ค่ายสุรินทร์หยินหยาง - Ultimate Hub",
Icon = "shield",
Author = "Delta Script",
Folder = "SurinYinYangHub",
Size = UDim2.fromOffset(580, 460),
KeySystem = false,
})
-- แจ้งเตือนเมื่อเปิดใช้งานสำเร็จ
WindUI:Notify({
Title = "ยินดีต้อนรับ",
Content = "โหลดสคริปต์ ค่ายสุรินทร์หยินหยาง สำเร็จ!",
Duration = 4
})
--------------------------------------------------------------------------------
-- 1. หมวดหมู่: บันทึกสคริปต์ (Delta Script Hub System)
--------------------------------------------------------------------------------
local TabSave = Window:Tab({
Title = "บันทึกสคริปต์",
Icon = "save",
})
local SecSaveSystem = TabSave:Section({ Title = "จัดการเซฟสคริปต์ (Editor & Save Slots)" })
-- ตรรกะระบบจัดการ Script Editor และ Save/Load
local DeltaScriptHub = {
Editor = {
ScriptBuffer1 = "",
ScriptBuffer2 = "",
ScriptBuffer3 = "",
SetScript1 = function(self, codeText) self.ScriptBuffer1 = codeText or "" end,
SetScript2 = function(self, codeText) self.ScriptBuffer2 = codeText or "" end,
SetScript3 = function(self, codeText) self.ScriptBuffer3 = codeText or "" end,
RunScript = function(self, target)
local code = (target == 1 and self.ScriptBuffer1) or (target == 2 and self.ScriptBuffer2) or self.ScriptBuffer3
if code == "" then
WindUI:Notify({ Title = "แจ้งเตือน", Content = "กรุณาใส่ Script ในช่องที่ " .. target, Duration = 2 })
return
end
local func, err = loadstring(code)
if not func then
WindUI:Notify({ Title = "Syntax Error", Content = tostring(err), Duration = 3 })
return
end
local success, runErr = pcall(func)
if not success then
WindUI:Notify({ Title = "Execution Error", Content = tostring(runErr), Duration = 3 })
else
WindUI:Notify({ Title = "สำเร็จ", Content = "รัน Script ช่องที่ " .. target .." เรียบร้อย", Duration = 2 })
end
end,
SaveAllScripts = function(self)
if writefile then
local data = "--- [DELTA SCRIPT HUB SAVE DATA] ---\n" ..
"[SLOT1]-->>\n" .. self.ScriptBuffer1 .. "\n<<--[SLOT1]\n" ..
"[SLOT2]-->>\n" .. self.ScriptBuffer2 .. "\n<<--[SLOT2]\n" ..
"[SLOT3]-->>\n" .. self.ScriptBuffer3 .. "\n<<--[SLOT3]"
pcall(function()
writefile("SurinYinYang_SaveSlot.txt", data)
end)
WindUI:Notify({ Title = "บันทึกสำเร็จ", Content = "บันทึกสคริปต์ทั้งหมดลงไฟล์เรียบร้อย", Duration = 3 })
else
WindUI:Notify({ Title = "ข้อผิดพลาด", Content = "ตัวรันไม่รองรับ writefile", Duration = 3 })
end
end,
LoadSavedScripts = function(self)
if readfile and isfile and isfile("SurinYinYang_SaveSlot.txt") then
local success, content = pcall(function()
return readfile("SurinYinYang_SaveSlot.txt")
end)
if success and content then
local s1 = content:match("%[SLOT1%]%-%->>(.-)<<%-%[SLOT1%]")
local s2 = content:match("%[SLOT2%]%-%->>(.-)<<%-%[SLOT2%]")
local s3 = content:match("%[SLOT3%]%-%->>(.-)<<%-%[SLOT3%]")
if s1 then self.ScriptBuffer1 = s1 end
if s2 then self.ScriptBuffer2 = s2 end
if s3 then self.ScriptBuffer3 = s3 end
WindUI:Notify({ Title = "โหลดสำเร็จ", Content = "ดึงข้อมูลสคริปต์จากช่องบันทึกสำเร็จ", Duration = 3 })
return s1, s2, s3
end
else
WindUI:Notify({ Title = "ไม่พบไฟล์", Content = "ยังไม่มีประวัติการบันทึกสคริปต์", Duration = 3 })
end
return nil, nil, nil
end
}
}
SecSaveSystem:Button({
Title = "💾 บันทึกสคริปต์ปัจจุบัน",
Callback = function()
DeltaScriptHub.Editor:SaveAllScripts()
end
})
SecSaveSystem:Button({
Title = "📂 โหลดสคริปต์ที่บันทึกไว้",
Callback = function()
DeltaScriptHub.Editor:LoadSavedScripts()
end
})
--------------------------------------------------------------------------------
-- 2. หมวดหมู่: AI สร้างสคริปต์
--------------------------------------------------------------------------------
local TabAI = Window:Tab({
Title = "AI สร้างสคริปต์",
Icon = "cpu",
})
local SecAI = TabAI:Section({ Title = "ระบบช่วยเขียนโค้ดอัตโนมัติ" })
SecAI:Button({
Title = "ประมวลผลและสร้างสคริปต์เสริม",
Callback = function()
WindUI:Notify({ Title = "AI Generator", Content = "ระบบ AI กำลังวิเคราะห์และสร้างฟังก์ชันเพิ่ม...", Duration = 3 })
end
})
--------------------------------------------------------------------------------
-- 3. หมวดหมู่: Player (ผู้เล่น)
--------------------------------------------------------------------------------
local TabPlayer = Window:Tab({
Title = "Player",
Icon = "user",
})
local SecPlayer = TabPlayer:Section({ Title = "ตั้งค่าตัวละคร" })
SecPlayer:Toggle({
Title = "เดินเร็วพิเศษ (WalkSpeed Hack)",
Callback = function(state)
if state then
pcall(function() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 50 end)
else
pcall(function() game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 end)
end
end
})
SecPlayer:Toggle({
Title = "กระโดดสูงพิเศษ (JumpPower Hack)",
Callback = function(state)
if state then
pcall(function() game.Players.LocalPlayer.Character.Humanoid.JumpPower = 120 end)
else
pcall(function() game.Players.LocalPlayer.Character.Humanoid.JumpPower = 50 end)
end
end
})
--------------------------------------------------------------------------------
-- 5. หมวดหมู่: การตั้งค่าระบบ
--------------------------------------------------------------------------------
local TabSettings = Window:Tab({
Title = "การตั้งค่าระบบ",
Icon = "settings",
})
local SecSettings = TabSettings:Section({ Title = "ตั้งค่า UI และ Delta" })
SecSettings:Toggle({
Title = "เปิด/ปิด เอฟเฟกต์หน้าต่าง",
Callback = function(state)
print("UI Effects:", state)
end
})
local DataStoreService = game:GetService("DataStoreService")
-- ตั้งชื่อฐานข้อมูลของคุณ (เปลี่ยนชื่อได้ตามต้องการ)
local playerDataStore = DataStoreService:GetDataStore("PlayerDataStore_v1")
-- ฟังก์ชันเมื่อผู้เล่นเข้าเกม (โหลดข้อมูล)
local function onPlayerAdded(player)
-- สร้างโฟลเดอร์ leaderstats สำหรับแสดงค่าข้อมูลบนกระดาน (Leaderboard)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
-- ตัวอย่างข้อมูลที่ต้องการบันทึก: ค่า Gold (ทอง)
local gold = Instance.new("IntValue")
gold.Name = "Gold"
gold.Value = 0
gold.Parent = leaderstats
-- ดึงรหัสความปลอดภัยตาม Player UserId
local playerKey = "Player_" .. player.UserId
-- โหลดข้อมูลที่เคยบันทึกไว้
local success, savedData = pcall(function()
return playerDataStore:GetAsync(playerKey)
end)
if success then
if savedData then
-- ถ้ามีข้อมูลเดิม บันทึกลงในตัวแปร Gold
gold.Value = savedData
print("โหลดข้อมูลสำเร็จสำหรับ: " .. player.Name .. " (Gold: " .. savedData .. ")")
else
print("ผู้เล่นใหม่: " .. player.Name .. " เริ่มต้นสร้างข้อมูลใหม่")
end
else
warn("เกิดข้อผิดพลาดในการโหลดข้อมูลของ: " .. player.Name)
end
end
-- ฟังก์ชันเมื่อผู้เล่นออกจากเกม (บันทึกข้อมูล)
local function onPlayerRemoving(player)
local playerKey = "Player_" .. player.UserId
-- ดึงค่า Gold ที่ต้องการบันทึก
local goldToSave = player.leaderstats.Gold.Value
-- บันทึกข้อมูลลง DataStore
local success, errorMessage = pcall(function()
playerDataStore:SetAsync(playerKey, goldToSave)
end)
if success then
print("บันทึกข้อมูลสำเร็จสำหรับ: " .. player.Name)
else
warn("ไม่สามารถบันทึกข้อมูลของ " .. player.Name .. " ได้: " .. tostring(errorMessage))
end
end
-- ผูกฟังก์ชันเข้ากับ Event ของเกม
game.Players.PlayerAdded:Connect(onPlayerAdded)
game.Players.PlayerRemoving:Connect(onPlayerRemoving)
-- บันทึกข้อมูลให้อัตโนมัติเมื่อ Server ปิดตัวลง (ป้องกันข้อมูลหายตอนกด Stop ใน Studio)
game:BindToClose(function()
for _, player in ipairs(game.Players:GetPlayers()) do
onPlayerRemoving(player)
end
end)
-- ========================================================
-- ค่ายสุรินทร์หยินหยาง - Script Saving & Management System (WindUI)
-- ========================================================
-- โหลดไลบรารี WindUI
local _version = "1.6.66"
local WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/download/" .. _version .. "/main.lua"))()
-- สร้างหน้าต่างหลัก (Window)
local Window = WindUI:CreateWindow({
Title = "ค่ายสุรินทร์หยินหยาง - Script Saver",
Icon = "save",
Author = "Delta Script",
Folder = "SurinYinYangHub",
Size = UDim2.fromOffset(580, 460),
KeySystem = false,
})
WindUI:Notify({
Title = "ระบบพร้อมใช้งาน",
Content = "เปิดระบบบันทึกสคริปต์เรียบร้อยแล้ว",
Duration = 3
})
--------------------------------------------------------------------------------
-- หมวดหมู่: ระบบบันทึกสคริปต์ (Script Saving System)
--------------------------------------------------------------------------------
local TabSaveManager = Window:Tab({
Title = "ระบบบันทึกสคริปต์",
Icon = "folder",
})
-- ตัวแปรเก็บค่าสคริปต์ชั่วคราว
local savedScriptContent = ""
local currentSlotName = "ScriptSlot_1"
local SecInput = TabSaveManager:Section({ Title = "1. พื้นที่ใส่ข้อความสคริปต์สำหรับบันทึก" })
SecInput:Input({
Title = "ชื่อไฟล์เซฟ (Slot Name)",
Placeholder = "เช่น MyScript1",
Callback = function(text)
if text and text ~= "" then
currentSlotName = text
end
end
})
SecInput:Input({
Title = "เนื้อหาสคริปต์ (Script Code)",
Placeholder = "วางโค้ดสคริปต์ของคุณที่นี่...",
Callback = function(text)
savedScriptContent = text or ""
end
})
local SecActions = TabSaveManager:Section({ Title = "2. จัดการบันทึกและโหลดข้อมูล" })
SecActions:Button({
Title = "💾 บันทึกสคริปต์ลงในเครื่อง",
Callback = function()
if writefile then
local filename = currentSlotName .. ".txt"
local success, err = pcall(function()
writefile(filename, savedScriptContent)
end)
if success then
WindUI:Notify({
Title = "บันทึกสำเร็จ",
Content = "บันทึกสคริปต์ลงไฟล์: " .. filename,
Duration = 3
})
else
WindUI:Notify({ Title = "เกิดข้อผิดพลาด", Content = tostring(err), Duration = 3 })
end
else
WindUI:Notify({ Title = "ไม่รองรับ", Content = "ตัวรันไม่รองรับฟังก์ชัน writefile", Duration = 3 })
end
end
})
SecActions:Button({
Title = "📂 โหลดสคริปต์ที่บันทึกไว้",
Callback = function()
if readfile and isfile then
local filename = currentSlotName .. ".txt"
if isfile(filename) then
local success, content = pcall(function()
return readfile(filename)
end)
if success and content then
savedScriptContent = content
WindUI:Notify({
Title = "โหลดสำเร็จ",
Content = "ดึงข้อมูลจากไฟล์ " .. filename .. " เรียบร้อย",
Duration = 3
})
end
else
WindUI:Notify({ Title = "ไม่พบไฟล์", Content = "ไม่พบไฟล์ชื่อ: " .. filename, Duration = 3 })
end
else
WindUI:Notify({ Title = "ไม่รองรับ", Content = "ตัวรันไม่รองรับฟังก์ชันอ่านไฟล์", Duration = 3 })
end
end
})
--------------------------------------------------------------------------------
-- หมวดหมู่: ตั้งค่าระบบ & ข้อมูล
--------------------------------------------------------------------------------
local TabInfo = Window:Tab({
Title = "ข้อมูลระบบ",
Icon = "info",
})
local SecInfo = TabInfo:Section({ Title = "รายละเอียด" })
SecInfo:Button({
Title = "สถานะระบบบันทึก",
Callback = function()
WindUI:Notify({
Title = "สถานะ",
Content = "ระบบเซฟไฟล์ทำงานปกติ (รองรับการบันทึกข้อความสคริปต์)",
Duration = 3
})
end
})
--------------------------------------------------------------------------------
-- 6. หมวดหมู่: ข้อมูลเพิ่มเติม & ฟังก์ชันใหม่
--------------------------------------------------------------------------------
local TabInfo = Window:Tab({
Title = "ข้อมูลเพิ่มเติม",
Icon = "info",
})
local SecInfo = TabInfo:Section({ Title = "รายละเอียดค่ายสุรินทร์หยินหยาง" })
SecInfo:Button({
Title = "ดูเครดิตผู้จัดทำ",
Callback = function()
WindUI:Notify({ Title = "เครดิต", Content = "Script Hub จัดทำสำหรับค่ายสุรินทร์หยินหยาง", Duration = 4 })
end
})