Vikajanana

Untitled

Jan 17th, 2024
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 55.36 KB | None | 0 0
  1. print("1")
  2. if not game:IsLoaded() then
  3. game.Loaded:Wait()
  4. end
  5. print("2")
  6. local rawlinkcallback = "https://raw.githubusercontent.com/AutoPlayerScript/AnimeDimension/main/ADS.lua"
  7. local rawlinkGUI = "https://raw.githubusercontent.com/AutoPlayerScript/AnimeDimension/main/LibGui.lua"
  8. local linkdiscord ="https://discord.gg/QJBEq64dc3"
  9. local linkkey24h ="https://work.ink/4zX/GetKey"
  10. local SCRIPT1 ="I'm too happy. It's coming soon"
  11. local SCRIPT2 ="I'm too happy. It's coming soon"
  12. local SCRIPT3 ="I'm too happy. It's coming soon"
  13. local linkDONATE="https://work.ink/4zX/DONATEME"
  14. local adminCode = "eventfree0user"
  15.  
  16.  
  17.  
  18. _G.Settings = {
  19. autofarm = false,
  20. farmselect = false,
  21. monster_selected ="No chosen",
  22. NormalAttack=false,
  23. super_Attack=false,
  24. SWZSkill=false,
  25. SWXSkill=false,
  26.  
  27. DFZSkill=false,
  28. DFXSkill=false,
  29. DFCSkill=false,
  30. DFVSkill=false,
  31. DFBSkill=false,
  32. DFESkill=false,
  33.  
  34. FSZSkill=false,
  35. FSXSkill=false,
  36. FSCSkill=false,
  37. FSVSkill=false,
  38. FSBSkill=false,
  39.  
  40. TeleON = false,
  41. Teleselect = "Teleport Behind",
  42.  
  43. Haki = true,
  44. Ken = false,
  45. equipauto = "Sword",
  46.  
  47. khoangcach = 10,
  48. target = false,
  49.  
  50. quest = "No Quest",
  51.  
  52. FarmAuto = false,
  53.  
  54. GSAuto = false,
  55. KaidoAuto = false,
  56. OdenAuto = false,
  57. Seaking = false,
  58. Bigmom = false,
  59. Hydra = false
  60.  
  61.  
  62.  
  63.  
  64.  
  65. }
  66.  
  67. local a = "Auto Player"
  68. local b = "King Legacy.lua"
  69. local gamefolder = "King Legacy"
  70. local key = "Key.txt"
  71.  
  72. local ModeAuto = {
  73. }
  74. print("load rawlinkGUI")
  75. local u = loadstring(game:HttpGet(rawlinkGUI))()
  76. function saveSettings()
  77. local c = game:GetService("HttpService")
  78. local d = c:JSONEncode(_G.Settings)
  79. if writefile then
  80. if isfolder(a) then
  81. if not isfolder(a .. "\\" .. gamefolder) then
  82. makefolder(a .. "\\" .. gamefolder)
  83. end
  84. writefile(a .. "\\" .. gamefolder .. "\\" .. b, d)
  85. else
  86. makefolder(a)
  87. if not isfolder(a .. "\\" .. gamefolder) then
  88. makefolder(a .. "\\" .. gamefolder)
  89. end
  90. writefile(a .. "\\" .. gamefolder .. "\\" .. b, d)
  91. end
  92. end
  93. end
  94. print("4")
  95. function loadSettings()
  96. local c = game:GetService("HttpService")
  97. local fullPath = a .. "\\" .. gamefolder .. "\\" .. b
  98. if isfile(fullPath) then
  99. return c:JSONDecode(readfile(fullPath))
  100. end
  101. return nil
  102. end
  103. _G.Settings = loadSettings() or _G.Settings
  104. print("5")
  105. --KEYCHECK - vô dungj quas
  106. function keyCheck()
  107. -- Get the current player's username and IP address
  108. local player = game.Players.LocalPlayer
  109. local username = player.Name
  110.  
  111. local response = game:GetService("HttpService"):JSONDecode(game:HttpGet("https://api.ipify.org?format=json"))
  112. local ip = response["ip"]
  113.  
  114. -- Create the contents of the Key.txt file
  115. local keyFileContents = os.time() .. "\n" .. username .. "\n" .. ip
  116.  
  117. -- Write the contents to the file
  118. local gamefolder = "ADS"
  119. local key = "Key.txt"
  120. local keyPath = a .. "\\" .. gamefolder .. "\\" .. key
  121.  
  122. if not isfolder(a .. "\\" .. gamefolder) then
  123. makefolder(a .. "\\" .. gamefolder)
  124. end
  125.  
  126. local success, error = pcall(writefile, keyPath, keyFileContents)
  127. if not success then
  128. warn("Failed to write to file: " .. error)
  129. end
  130. end
  131. print("6")
  132. --keyCheck() -- Tao file key sieu nang
  133.  
  134.  
  135. print("7")
  136.  
  137. function keyValid(inputKey)
  138. local timeLimit = 36000 -- thời hạn của key tính bằng giây (10 giờ)
  139.  
  140. -- Kiểm tra ADMIN code
  141. if inputKey == adminCode then
  142. return true
  143. end
  144.  
  145. -- Kiểm tra độ dài key
  146. if type(inputKey) ~= "string" or #inputKey ~= 13 or not string.match(inputKey, "^[0-9a-fA-F]+$") then
  147. return false
  148. end
  149.  
  150. -- Tách giá trị hex cần thiết
  151. local hexString1 = inputKey:sub(2, 6) -- lấy từ vị trí thứ 2 đến vị trí thứ 6
  152. local hexString2 = inputKey:sub(8, 12) -- lấy từ vị trí thứ 8 đến vị trí thứ 12
  153.  
  154. -- Ghép các chuỗi hex cần thiết và đảo ngược thứ tự các ký tự
  155. local hexString = hexString1 .. hexString2
  156. -- Đảo ngược thứ tự các ký tự trong chuỗi hex
  157. hexString = hexString:reverse()
  158.  
  159. -- Xóa bỏ các ký tự 0 ở đầu chuỗi
  160. hexString = hexString:gsub("^0+", "")
  161.  
  162. -- Chuyển đổi giá trị hex sang decimal
  163. local decValue = tonumber(hexString, 16)
  164.  
  165.  
  166. --[[-- Đọc thời gian từ file Key.txt
  167. local file = io.open(a .. "\\" .. key, "r")
  168. if not file then
  169. return false
  170. end
  171.  
  172. local fileTimeString = file:read("*line")
  173. file:close()
  174.  
  175. if not fileTimeString then
  176. return false
  177. end
  178.  
  179. -- Chuyển đổi thời gian từ chuỗi sang số
  180. local fileTime = tonumber(fileTimeString)
  181. print(fileTime)
  182. if fileTime == nil then
  183. return false
  184. end
  185. --]]
  186. local fileTime = os.time()
  187. print(fileTime)
  188. -- So sánh thời gian với thời gian trong file Key.txt
  189. if (decValue - fileTime) > timeLimit or (decValue - fileTime) < (0-timeLimit) then
  190. return false
  191. end
  192.  
  193. -- Key hợp lệ
  194. return true
  195. end
  196.  
  197.  
  198.  
  199.  
  200. -- Lưu giá trị checkKey ban đầu
  201. local checkKey = keyValid(_G.Settings.inputKey)
  202. print("8")
  203. --[[ Kiểm tra giá trị của checkKey
  204. if not game:IsLoaded() then
  205. game.Loaded:Wait()
  206. end
  207. --]]
  208. -- Kiểm tra giá trị của checkKey lần thứ hai
  209. if not checkKey then
  210. checkKey = keyValid(_G.Settings.inputKey)
  211. end
  212. -- Tạo UI
  213. print("9")
  214. local e = game:GetService("ReplicatedStorage")
  215. local f = game:GetService("VirtualInputManager")
  216. local g = game:GetService("Players")
  217. local h = game:GetService("VirtualUser")
  218. local i = game:GetService("TweenService")
  219. local j = g.LocalPlayer
  220. --local u = loadstring(game:HttpGet(rawlinkGUI))()
  221. --hide/show GUI
  222. function HideGui()
  223. local k = game.CoreGui:FindFirstChild("Autoplayer")
  224. local l
  225. for m, n in pairs(k:GetChildren()) do
  226. if m == 2 then
  227. l = n
  228. end
  229. end
  230. if k.Enabled then
  231. l:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, .6, true)
  232. repeat
  233. task.wait()
  234. until l.Size.Y.Offset < 1
  235. k.Enabled = false
  236. else
  237. l:TweenSize(UDim2.new(0, 615, 0, 344), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, .6, true)
  238. repeat
  239. task.wait()
  240. until l.Size.Y.Offset > 1
  241. k.Enabled = true
  242. end
  243. end
  244. spawn(
  245. function()
  246. j = game.Players.LocalPlayer
  247. Mouse = j:GetMouse()
  248. Mouse.KeyDown:connect(
  249. function(o)
  250. o = o:lower()
  251. if o == _G.Settings.toggleguikey then
  252. task.spawn(HideGui)
  253. end
  254. end
  255. )
  256. end
  257. )
  258. --Anti AFK
  259. j.Idled:Connect(
  260. function()
  261. h:ClickButton2(Vector2.new())
  262. end
  263. )
  264. print("10")
  265. if true then --or checkKey
  266. print("1.0")
  267. -- Tạo UI nếu có Key đúng
  268. local v = u:MakeWindow({Name = " AutoPlayer - King Legacy BETA 1.2", HidePremium = true})
  269. print("1.1")
  270. local w = v:MakeTab({Name = "Auto Mode", PremiumOnly = false})
  271. local x = v:MakeTab({Name = "Manual Mode", PremiumOnly = false})
  272. print("1.2")
  273. local y = v:MakeTab({Name = "Skill & Tele", PremiumOnly = false})
  274. print("1.3")
  275. local z = v:MakeTab({Name = "Equip Auto", PremiumOnly = false})
  276. print("1.4")
  277. local A = v:MakeTab({Name = "Misc", PremiumOnly = false})
  278. --local B = v:MakeTab({Name = "Misc & Notification", PremiumOnly = false})
  279. local C = v:MakeTab({Name = "☣AutoPlayer☣", PremiumOnly = false})
  280. print("Load GUI OK ")
  281. --AutoMode
  282.  
  283.  
  284. -------------------Manual Mode-----------------------------------
  285. --local enemy = _G.Settings.monster_selected or nil
  286. local Monster = {
  287. "No chosen",
  288. "Shark Cannie",
  289. "Soldier [Lv. 1]",
  290. "Clown Pirate [Lv. 10]",
  291. "Shadow Master [Lv. 1600]",
  292. "New World Pirate [Lv. 1700]",
  293. "Rear Admiral [Lv. 1800]",
  294. "True Karate Fishman [Lv. 1850]",
  295. "-----Sea 2-------",
  296. "Powerful Beast Pirate [Lv. 2450]",
  297. "Violet Samurai [Lv. 2500]",
  298. "Kitsune Samurai [Lv. 2650]",
  299. --"Skull Pirate [Lv. 3050]",
  300. "Elite Skeleton [Lv. 3100]",
  301. "Desert Thief [Lv. 3125]",
  302. "Anubis [Lv. 3150]",
  303. --"Pharaoh [Lv. 3175]",
  304. "Flame User [Lv. 3200]",
  305. "Azlan [Lv. 3300]",
  306. "Prince Aria[Lv. 3700]",
  307. "Floffy [Lv. 3775]",
  308. "Dead Troupe [Lv. 3800]",
  309. "---WaitUpdate More Monster---",
  310. "--------If boss Error---------",
  311. "King Samurai [Lv. 3500]",
  312. "SeaKing",
  313. "Big Mother [Lv. 7500] - not yet ",
  314. "Dragon - not yet"
  315.  
  316. }
  317. local Tele ={
  318. "Teleport Behind",
  319. "Teleport Top(Wait Update)",
  320. "OFF"
  321. }
  322. ------------------------------------------------------------------------------
  323.  
  324.  
  325. local function teleportToTarget(targetPosition)
  326. local character = game.Players.LocalPlayer.Character
  327. local humanoidRootPart = nil
  328.  
  329. local function waitForHumanoidRootPart()
  330. repeat
  331. humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
  332. wait()
  333. until humanoidRootPart
  334. end
  335.  
  336. coroutine.wrap(waitForHumanoidRootPart)()
  337.  
  338. humanoidRootPart.CFrame = targetPosition
  339. end
  340.  
  341.  
  342.  
  343.  
  344.  
  345. local function filterMonstersByName(name)
  346. local filteredMonsters = {}
  347.  
  348. local monsterFolders = {
  349. game:GetService("Workspace").Monster and game:GetService("Workspace").Monster:FindFirstChild("Mon"),
  350. game:GetService("Workspace").Monster and game:GetService("Workspace").Monster:FindFirstChild("Boss"),
  351. game:GetService("Workspace"):FindFirstChild("SeaMonster"),
  352. game:GetService("Workspace"):FindFirstChild("GhostMonster")
  353. }
  354.  
  355.  
  356. for _, folder in ipairs(monsterFolders) do
  357. if folder and folder:IsA("Folder") then
  358. for _, monster in ipairs(folder:GetChildren()) do
  359. if monster.Name == name and monster:IsA("Model") and monster:FindFirstChild("Humanoid") and monster.Humanoid.Health > 0 then
  360. table.insert(filteredMonsters, monster)
  361. end
  362. end
  363. end
  364. end
  365.  
  366. return filteredMonsters
  367. end
  368.  
  369. -------------------Vitri Spawn khi ko co quai--------------
  370.  
  371. local no_monster
  372. local questLvl
  373. if game.PlaceId == 4520749081 then
  374. local sharkCanniePositions = {
  375. --game.Workspace.AllNPC.QuestLvl1850,
  376. game.Workspace.AllNPC.QuestLvl230,
  377. game.Workspace.AllNPC.QuestLvl200 }
  378. end
  379.  
  380.  
  381.  
  382.  
  383. local sharkCanniePositionIndex = 1
  384.  
  385. local function getMonsterCFrame(cframe)
  386. local success, result = pcall(function()
  387. return cframe.CFrame
  388. end)
  389.  
  390. if success then
  391. return result + Vector3.new(0, 5, 0)
  392. else
  393. return nil
  394. end
  395. end
  396.  
  397. local function updateNoMonster()
  398. local monster_selected = _G.Settings.monster_selected
  399.  
  400. if monster_selected == "Desert Thief [Lv. 3125]" then
  401. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3100)
  402. questLvl = "QuestLvl3100"
  403. elseif monster_selected == "Anubis [Lv. 3150]" then
  404. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3125)
  405. questLvl = "QuestLvl3125"
  406. elseif monster_selected == "Pharaoh [Lv. 3175]" then
  407. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3150)
  408. questLvl = "QuestLvl310"
  409. elseif monster_selected == "Flame User [Lv. 3200]" then
  410. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3175)
  411. questLvl = "QuestLvl3175"
  412. elseif monster_selected == "Skull Pirate [Lv. 3050]" then
  413. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3025)
  414. questLvl = "QuestLvl3"
  415. elseif monster_selected == "Elite Skeleton [Lv. 3100]" then
  416. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3075)
  417. questLvl = "QuestLvl3075"
  418. elseif monster_selected == "DarkBeard [Lv. 3475]" then
  419. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3475)
  420. questLvl = "QuestLvl3475"
  421. elseif monster_selected == "Light [Lv. 3575]" then
  422. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3575)
  423. questLvl = "QuestLvl3575"
  424. elseif monster_selected == "Ice King [Lv. 3350]" then
  425. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3350)
  426. questLvl = "QuestLvl3350"
  427. elseif monster_selected == "The Crimson [Lv. 3375]" then
  428. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl3375)
  429. questLvl = "QuestLvl3375"
  430. elseif monster_selected == "King Samurai [Lv. 3500]" then
  431. no_monster = getMonsterCFrame(game.Workspace.Island["A - Japan"]["King Samurai Spawn"])
  432. questLvl = nil
  433. elseif monster_selected == "Shark Cannie" then
  434. no_monster = getMonsterCFrame(game.Workspace.AllNPC.QuestLvl200)
  435. questLvl = nil
  436.  
  437. elseif _G.Settings.monster_selected == "SeaKing" then
  438. local legacyIsland = nil
  439. local hasLegacyIsland = false
  440.  
  441. for i = 1, 9 do
  442. local legacyIslandModel = game.Workspace.Island:FindFirstChild("Legacy Island" .. i)
  443. if legacyIslandModel then
  444. legacyIsland = legacyIslandModel
  445. hasLegacyIsland = true
  446. break
  447. end
  448. wait()
  449. end
  450.  
  451. if not hasLegacyIsland then
  452. legacyIsland = game.Workspace.Island:FindFirstChild("Legacy Island")
  453. end
  454.  
  455. if legacyIsland then
  456. local chestSpawner = legacyIsland:FindFirstChild("ChestSpawner")
  457. if chestSpawner then
  458. no_monster = chestSpawner.CFrame + Vector3.new(0, 5, 0)
  459. else
  460. no_monster = nil
  461. end
  462.  
  463. end
  464.  
  465. else
  466. local teleselectLevel = tonumber(monster_selected:match("%d+"))
  467. local questLevelPartName = "QuestLvl" .. (teleselectLevel or "")
  468.  
  469. if game.Workspace.AllNPC:FindFirstChild(questLevelPartName) then
  470. no_monster = getMonsterCFrame(game.Workspace.AllNPC[questLevelPartName])
  471. questLvl = questLevelPartName
  472. else
  473. no_monster = nil
  474. questLvl = nil
  475. end
  476. end
  477. end
  478.  
  479.  
  480.  
  481. print("monster update")
  482. -- Cập nhật giá trị của no_monster khi monster_selected thay đổi
  483. updateNoMonster()
  484.  
  485. --================================================================
  486. w:AddLabel("--IN DEVELOPING WAIT FOR UPDATE--")
  487. w:AddLabel("AUTO LEVEL")
  488. w:AddLabel("GHOSTSHIP")
  489. w:AddLabel("HYDRA")
  490. w:AddLabel("SEAKING")
  491. w:AddLabel("BIG MOM")
  492. w:AddLabel("ODEN")
  493. w:AddLabel("HOP SERVER TO FIND BOSS")
  494.  
  495.  
  496. ------------=========================test
  497. x:AddDropdown(
  498. {Name = " ⭕ Choose Monster", Default = _G.Settings.monster_selected, Options = Monster, Callback = function(H)
  499. _G.Settings.monster_selected = H
  500. saveSettings()
  501. end}
  502. )
  503. x:AddDropdown(
  504. {Name = " ⭕ Choose Tele Mode", Default = _G.Settings.Teleselect, Options = Tele, Callback = function(H)
  505. _G.Settings.Teleselect = H
  506. saveSettings()
  507. end}
  508. )
  509. x:AddDropdown(
  510. {
  511. Name = " ⭕ Quest or No ?!?",
  512. Default = _G.Settings.quest,
  513. Options = {"No Quest","Quest"},
  514. Callback = function(H)
  515. _G.Settings.quest = H
  516. saveSettings()
  517. if _G.Settings.quest == "Quest" then
  518. task.spawn(function()
  519. while _G.Settings.TeleON and _G.Settings.quest == "Quest" do
  520.  
  521. if no_monster ~= nil and not game.Players.LocalPlayer.PlayerGui.Quest.QuestBoard.Visible then
  522. -- Lấy tên đầy đủ của QuestLvlxxxx từ no_monster
  523. print("Nhan questLvl "..questLvl)
  524. if questLvl ~= nil then
  525. -- Lấy đối tượng QuestLvlxxxx từ workspace.AllNPC
  526. local questNPC = workspace.AllNPC:FindFirstChild(questLvl)
  527. --print("questLvl "..questLvl)
  528. -- Gọi nhiệm vụ
  529. local args = {
  530. [1] = questNPC
  531. }
  532. game:GetService("ReplicatedStorage").Remotes.Functions:WaitForChild("CheckQuest"):InvokeServer(unpack(args))
  533.  
  534. -- Bấm Accept-------------------------
  535. -- Lấy Gui
  536. while true do
  537. -- Kiểm tra sự tồn tại của acceptButton
  538. local acceptButtonExists, acceptButton = pcall(function()
  539. return game.Players.LocalPlayer.PlayerGui[questLvl].Dialogue.Accept
  540. end)
  541.  
  542. if acceptButtonExists then
  543. -- Truy cập acceptButton thành công
  544. wait(1)
  545. local function clickImageButton(button)
  546. local position = button.AbsolutePosition
  547. local size = button.AbsoluteSize
  548.  
  549. -- Calculate the click position relative to the acceptButton
  550. local clickX = position.X + size.X/2
  551. local clickY = position.Y + size.Y/2
  552.  
  553. -- Create an ImageLabel to cover the real mouse cursor
  554. local mouseCover = Instance.new("ImageLabel")
  555. mouseCover.BackgroundTransparency = 0.5
  556. mouseCover.Size = UDim2.new(0, 1, 0, 1)
  557. mouseCover.Image = "rbxassetid://12915051392" -- Replace with a transparent image asset ID
  558. mouseCover.Position = UDim2.new(0, clickX, 0, clickY)
  559. mouseCover.Parent = game.Players.LocalPlayer.PlayerGui
  560. -- Move the mouse cursor to the click position
  561. mousemoveabs(clickX, clickY)
  562. -- Simulate left mouse button click
  563. --mouse1press()
  564. wait(0.001)
  565. mousemoveabs(clickX, clickY)
  566. wait(0.001)
  567. --mouse1release()
  568. mouse1click()
  569. -- Clean up
  570. mouseCover:Destroy()
  571.  
  572. end
  573.  
  574. clickImageButton(acceptButton)
  575. wait(0.3)
  576. clickImageButton(acceptButton)
  577. wait()
  578. -- OK CODE
  579. else
  580. break -- Thoát khỏi vòng lặp nếu không tìm thấy nút Accept
  581. end
  582. end
  583. else
  584. wait(3)
  585. end
  586. end
  587. wait()
  588. end -- end while
  589.  
  590. end)
  591. end
  592. end
  593. }
  594. )
  595.  
  596.  
  597. --=============================================================================================--=============================================================================================
  598.  
  599. local function teleportIfNoMonster()
  600. if no_monster ~= nil then
  601. teleportToTarget(no_monster)
  602. end
  603. end
  604. local monsterSelected
  605. local teleRunning = false -- Biến flag để kiểm tra trạng thái của vòng lặp TeleON
  606. print("tạo nút Farm selected")
  607.  
  608. x:AddToggle({
  609. Name = "Farm Selected",
  610. Default = _G.Settings.TeleON,
  611. Callback = function(H)
  612. _G.Settings.TeleON = H
  613. print("BAT/Tat Farm selected")
  614. saveSettings()
  615.  
  616. if _G.Settings.TeleON then
  617. print("TeleON")
  618. task.spawn(function()
  619. while _G.Settings.TeleON do
  620. teleRunning = true
  621. --print("teleRunning")
  622.  
  623. if _G.Settings.Teleselect == Tele[1] then
  624. --print("Teleselect = Tele[1]")
  625. pcall(function()
  626. repeat
  627. if _G.Settings.monster_selected == "Shark Cannie" then
  628. print("Đây là trường hợp đặc biệt của Shark Cannie")
  629. local sharkManMonsters = filterMonstersByName("Shark Man [Lv. 230]")
  630. local karateFishmanMonsters = filterMonstersByName("Karate Fishman [Lv. 200]")
  631. --local trueKarateFishmanMonsters = filterMonstersByName("True Karate Fishman [Lv. 1850]")
  632.  
  633. if #sharkManMonsters > 0 then
  634. targetMonster = sharkManMonsters[1]
  635. elseif #karateFishmanMonsters > 0 then
  636. targetMonster = karateFishmanMonsters[1]
  637. --elseif #trueKarateFishmanMonsters > 0 then
  638. -- targetMonster = trueKarateFishmanMonsters[1]
  639. end
  640. else
  641. local monsters = filterMonstersByName(_G.Settings.monster_selected)
  642. if #monsters > 0 then
  643. targetMonster = monsters[1]
  644. end
  645. end
  646.  
  647. --print("Repeat ")
  648. _G.Settings.target = false
  649. --print("Ko đánh....1 ")
  650. --saveSettings()
  651.  
  652. if targetMonster == nil then
  653. teleportIfNoMonster()
  654. _G.Settings.target = false
  655. --print("Ko đánh....do ko co muc tieu ")
  656. saveSettings()
  657.  
  658. if _G.Settings.monster_selected ~= monsterSelected then
  659. monsterSelected = _G.Settings.monster_selected
  660. updateNoMonster()
  661. teleportIfNoMonster()
  662. end
  663. wait(3)
  664. else
  665. --print("so luong monsters >0 tele and ...." )
  666. local targetPosition = targetMonster.HumanoidRootPart.CFrame - targetMonster.HumanoidRootPart.CFrame.lookVector * 5
  667. teleportToTarget(targetPosition)
  668.  
  669. -- Save monster if attacked
  670. _G.Settings.target = true
  671. --print("ATTACKKKKKKKKKKKKKKKKKKKKKK")
  672. --saveSettings()
  673.  
  674. wait(0.01)
  675. end
  676. until not _G.Settings.TeleON or _G.Settings.Teleselect ~= Tele[1]
  677.  
  678. teleRunning = false
  679. end)
  680.  
  681. elseif _G.Settings.Teleselect == Tele[2] then -- ONTOP
  682. -- Xử lý Tele 2
  683. local function lieDown(target)
  684. local targetPosition = target.HumanoidRootPart.CFrame.Position
  685. local playerPosition = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position
  686. local offset = targetPosition - playerPosition
  687. local newPosition = playerPosition + offset
  688. local newCFrame = CFrame.new(newPosition)
  689. newCFrame = newCFrame - newCFrame.lookVector * 10 + Vector3.new(0, -10, 0)
  690. newCFrame = newCFrame * CFrame.Angles(0, math.rad(90), 0)
  691. game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = newCFrame
  692.  
  693. local function checkDistance()
  694. local distance = (targetPosition - playerPosition).Magnitude
  695. return distance < 20
  696. end
  697.  
  698. while checkDistance() do
  699. wait(0.1)
  700. end
  701.  
  702. local function onMonsterDeath()
  703. changeTarget()
  704. end
  705.  
  706. target.Died:Connect(onMonsterDeath)
  707. end
  708.  
  709. pcall(function()
  710. repeat
  711. local monsters = filterMonstersByName(_G.Settings.monster_selected)
  712.  
  713. _G.Settings.target = false
  714. --print("Ko đánh....1 ")
  715.  
  716. if #monsters <= 0 then
  717. teleportIfNoMonster()
  718. _G.Settings.target = false
  719. --print("Ko đánh....do ko co muc tieu ")
  720.  
  721. if _G.Settings.monster_selected ~= monsterSelected then
  722. monsterSelected = _G.Settings.monster_selected
  723. updateNoMonster()
  724. teleportIfNoMonster()
  725. end
  726. wait(3)
  727. else
  728. local targetMonster = monsters[1]
  729. local targetPosition = targetMonster.HumanoidRootPart.CFrame - targetMonster.HumanoidRootPart.CFrame.lookVector * 5
  730. teleportToTarget(targetPosition)
  731.  
  732. -- Save monster if attacked
  733. _G.Settings.target = true
  734. --print("ATTACKKKKKKKKKKKKKKKKKKKKKK")
  735.  
  736. lieDown(targetMonster)
  737.  
  738. wait(0.01)
  739. end
  740. until not _G.Settings.TeleON or _G.Settings.Teleselect ~= Tele[2]
  741.  
  742. teleRunning = false
  743. end)
  744.  
  745.  
  746. elseif _G.Settings.Teleselect == Tele[3] then
  747. -- Xử lý Tele 3
  748. end
  749. wait(0.01)
  750. end
  751.  
  752. teleRunning = false
  753. end)
  754. else
  755. teleRunning = false
  756. end
  757. end
  758. })
  759.  
  760.  
  761.  
  762. y:AddLabel("Skill")
  763. y:AddToggle({
  764. Name = "Normal Attack (click)",
  765. Default = _G.Settings.NormalAttack,
  766. Callback = function(H)
  767. _G.Settings.NormalAttack = H
  768. saveSettings()
  769.  
  770. if _G.Settings.NormalAttack then
  771. task.spawn(function()
  772. local LocalPlayer = game.Players.LocalPlayer
  773. local swordName = LocalPlayer.PlayerStats.SwordName.Value
  774. local meleeName = LocalPlayer.PlayerStats.FightingStyle.Value
  775. local devilFName = LocalPlayer.PlayerStats.DFName.Value
  776.  
  777. local swName = "SW_" .. swordName .. "_M1"
  778. local fsName = "FS_" .. meleeName .. "_M1"
  779. local dfName = "DF_" .. devilFName .. "_M1"
  780. local character = LocalPlayer.Character
  781. local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
  782.  
  783. while _G.Settings.NormalAttack do
  784. if _G.Settings.target and humanoidRootPart then
  785. local targetCFrame = humanoidRootPart.CFrame * CFrame.new(0, 0, -10)
  786. --sw
  787. local args = {
  788. [1] = swName,
  789. [2] = {
  790. ["MouseHit"] = targetCFrame,
  791. ["Type"] = "Down"
  792. },
  793. }
  794.  
  795. game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Functions"):WaitForChild("SkillAction"):InvokeServer(unpack(args))
  796. if _G.Settings.super_Attack then
  797. --melee
  798. local args = {
  799. [1] = fsName
  800. }
  801.  
  802. game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Functions"):WaitForChild("SkillAction"):InvokeServer(unpack(args))
  803. --df
  804. local args = {
  805. [1] = dfName,
  806. [2] = {
  807. ["MouseHit"] = targetCFrame,
  808. ["Type"] = "Down"
  809. },
  810. }
  811.  
  812. game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Functions"):WaitForChild("SkillAction"):InvokeServer(unpack(args))
  813. end
  814. end
  815. wait() -- Đợi một khoảng thời gian trước khi gọi lại hàm
  816. end
  817. end)
  818. else
  819. --do nothing
  820. end
  821. end
  822.  
  823. })
  824.  
  825.  
  826. y:AddToggle({
  827. Name = "Extra 3 in 1 Punch",
  828. Default = _G.Settings.super_Attack,
  829. Callback = function(H)
  830. _G.Settings.super_Attack = H
  831. saveSettings()
  832. end
  833. })
  834.  
  835.  
  836. local function sendSkillRequest(args)
  837. game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("Functions"):WaitForChild("SkillAction"):InvokeServer(unpack(args))
  838. end
  839.  
  840. local function sendSkillDown(weapon, button)
  841. local player = game.Players.LocalPlayer
  842. local character = player.Character or player.CharacterAdded:Wait()
  843. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  844. local direction = humanoidRootPart.CFrame.LookVector.Unit * 10
  845. local weaponName = nil
  846.  
  847. if weapon == "SW" then
  848. weaponName = player.PlayerStats.SwordName.Value
  849. elseif weapon == "DF" then
  850. weaponName = player.PlayerStats.DFName.Value
  851. elseif weapon == "FS" then
  852. weaponName = player.PlayerStats.FightingStyle.Value
  853. end
  854.  
  855. local swZ = weapon .. "_" .. weaponName .. "_" .. button
  856.  
  857. local args = {
  858. [1] = swZ,
  859. [2] = {
  860. ["MouseHit"] = humanoidRootPart.CFrame + direction,
  861. ["Type"] = "Down"
  862. }
  863. }
  864.  
  865. sendSkillRequest(args)
  866. end
  867.  
  868. local function sendSkillUp(weapon, button)
  869. local player = game.Players.LocalPlayer
  870. local character = player.Character or player.CharacterAdded:Wait()
  871. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  872. local direction = humanoidRootPart.CFrame.LookVector.Unit * 10
  873. local weaponName = nil
  874.  
  875. if weapon == "SW" then
  876. weaponName = player.PlayerStats.SwordName.Value
  877. elseif weapon == "DF" then
  878. weaponName = player.PlayerStats.DFName.Value
  879. elseif weapon == "FS" then
  880. weaponName = player.PlayerStats.FightingStyle.Value
  881. end
  882.  
  883. local swZ = weapon .. "_" .. weaponName .. "_" .. button
  884.  
  885. local args = {
  886. [1] = swZ,
  887. [2] = {
  888. ["MouseHit"] = humanoidRootPart.CFrame + direction,
  889. ["Type"] = "Up"
  890. }
  891. }
  892.  
  893. sendSkillRequest(args)
  894. end
  895. y:AddLabel("SWORD - SKILL")
  896. local function createSwordSkillToggle(skillKey)
  897. y:AddToggle({
  898. Name = "Sword Skill " .. skillKey,
  899. Default = _G.Settings["SW" .. skillKey .. "Skill"],
  900. Callback = function(H)
  901. _G.Settings["SW" .. skillKey .. "Skill"] = H
  902. saveSettings()
  903. if H then
  904. task.spawn(function()
  905. while _G.Settings["SW" .. skillKey .. "Skill"] do
  906. if _G.Settings.target and (_G.Settings.TeleON or false) then -- doi false thanh danh boss chang han
  907. task.spawn(function()
  908. sendSkillDown("SW", skillKey)
  909. task.wait(0.1)
  910. sendSkillUp("SW", skillKey)
  911. task.wait(0.1)
  912. end)
  913. end
  914. task.wait(math.random(0.5, 3))
  915. end
  916. end)
  917. end
  918. end
  919. })
  920. end
  921.  
  922. local function createMeleeSkillToggle(skillKey)
  923. y:AddToggle({
  924. Name = "Melee Skill " .. skillKey,
  925. Default = _G.Settings["FS" .. skillKey .. "Skill"],
  926. Callback = function(H)
  927. _G.Settings["FS" .. skillKey .. "Skill"] = H
  928. saveSettings()
  929. if H then
  930. task.spawn(function()
  931. while _G.Settings["FS" .. skillKey .. "Skill"] do
  932. if _G.Settings.target and (_G.Settings.TeleON or false) then -- doi false thanh danh boss chang han
  933. task.spawn(function()
  934. sendSkillDown("FS", skillKey)
  935. task.wait(0.1)
  936. sendSkillUp("FS", skillKey)
  937. task.wait(0.1)
  938. end)
  939. end
  940. task.wait(math.random(0.5, 3))
  941. end
  942. end)
  943. end
  944. end
  945. })
  946. end
  947.  
  948. local function createDevilFruitSkillToggle(skillKey)
  949. y:AddToggle({
  950. Name = "DF Skill " .. skillKey,
  951. Default = _G.Settings["DF" .. skillKey .. "Skill"],
  952. Callback = function(H)
  953. _G.Settings["DF" .. skillKey .. "Skill"] = H
  954. saveSettings()
  955. if H then
  956. task.spawn(function()
  957. while _G.Settings["DF" .. skillKey .. "Skill"] do
  958. if _G.Settings.target and (_G.Settings.TeleON or false) then -- doi false thanh danh boss chang han
  959. task.spawn(function()
  960. sendSkillDown("DF", skillKey)
  961. task.wait(0.1)
  962. sendSkillUp("DF", skillKey)
  963. task.wait(0.1)
  964. end)
  965. end
  966. task.wait(math.random(0.5, 3))
  967. end
  968. end)
  969. end
  970. end
  971. })
  972. end
  973.  
  974. -- Gọi các hàm tạo skill toggle cho từng kỹ năng
  975. createSwordSkillToggle("Z")
  976. createSwordSkillToggle("X")
  977. y:AddLabel("-----------Fighting Style-----------")
  978. createMeleeSkillToggle("Z")
  979. createMeleeSkillToggle("X")
  980. createMeleeSkillToggle("C")
  981. createMeleeSkillToggle("V")
  982. y:AddLabel("-----DEVIL FRUIT------")
  983. createDevilFruitSkillToggle("Z")
  984. createDevilFruitSkillToggle("X")
  985. createDevilFruitSkillToggle("C")
  986. createDevilFruitSkillToggle("V")
  987. createDevilFruitSkillToggle("B")
  988. createDevilFruitSkillToggle("E")
  989.  
  990.  
  991. ---------------------------Equip On
  992. z:AddToggle({
  993. Name = "Auto HAKI",
  994. Default = _G.Settings.Haki,
  995. Callback = function(H)
  996. _G.Settings.Haki = H
  997. saveSettings()
  998.  
  999. task.spawn(function()
  1000. while _G.Settings.Haki do
  1001. task.wait(4)
  1002. print("checking haki.........")
  1003. local playerName = game:GetService("Players").LocalPlayer.Name
  1004. local hakiValue = Workspace.PlayerCharacters:WaitForChild(playerName).Haki.Value
  1005. if hakiValue == 0 then
  1006. game:GetService("Players").LocalPlayer.Character.Services.Client.Armament:FireServer()
  1007. end
  1008. end
  1009.  
  1010. local playerName = game:GetService("Players").LocalPlayer.Name
  1011. local hakiValue = Workspace.PlayerCharacters:WaitForChild(playerName).Haki.Value
  1012.  
  1013. if hakiValue == 1 and _G.Settings.Haki == false then
  1014. game:GetService("Players").LocalPlayer.Character.Services.Client.Armament:FireServer()
  1015. end
  1016. end)
  1017. end
  1018. })
  1019.  
  1020.  
  1021. z:AddToggle({
  1022. Name = "Auto Ken",
  1023. Default = _G.Settings.Ken,
  1024. Callback = function(H)
  1025. _G.Settings.Ken = H
  1026. saveSettings()
  1027.  
  1028. task.spawn(function()
  1029. while _G.Settings.Ken do
  1030. task.wait(2)
  1031. local playerName = game:GetService("Players").LocalPlayer.Name
  1032. local player = game:GetService("Players").LocalPlayer
  1033. if player.Character then
  1034. local kenHakiValue = Workspace.PlayerCharacters:WaitForChild(playerName).KenHaki.Value
  1035. local kenOpenValue = Workspace.PlayerCharacters:WaitForChild(playerName).KenOpen.Value
  1036.  
  1037. if kenHakiValue >= 7 and not kenOpenValue then
  1038. game:GetService("Players").LocalPlayer.Character.Services.Client.KenEvent:InvokeServer()
  1039. print("DA Bat Ken ")
  1040. end
  1041. end
  1042. end
  1043. end)
  1044. end
  1045. })
  1046.  
  1047.  
  1048. --[[ z:AddDropdown({
  1049. Name = "Equip Auto Weapon",
  1050. Default = _G.Settings.equipauto,
  1051. Options = {"Sword", "Fruit Power", "Combat"},
  1052. Callback = function(H)
  1053. _G.Settings.equipauto = H
  1054. saveSettings()
  1055. task.spawn(function()
  1056. task.wait(4)
  1057. local hotbar = game.CoreGui.RobloxGui.Backpack.Hotbar
  1058. local children = hotbar:GetChildren()
  1059. print("Chuẩn bị chọn vũ khí-----------------------------------------------------")
  1060. for _, child in ipairs(children) do
  1061. if child:IsA("TextButton") and child.ToolTip.Text == _G.Settings.equipauto and not child:FindFirstChild("Equipped") then
  1062. child.Callback:Fire() -- Gọi hàm Callback của TextButton
  1063. print("Đã chọn vũ khí---------------")
  1064. break
  1065. end
  1066. print("Không tìm thấy vũ khí phù hợp ------------------------------------------------")
  1067. end
  1068. end)
  1069. end
  1070. })
  1071.  
  1072.  
  1073. ]]
  1074.  
  1075. A:AddButton({
  1076. Name = "Change Sea 1<=>2",
  1077. Icon = "click",
  1078. Callback = function()
  1079. --setclipboard(linkDONATE) --linkverse earning
  1080. u:MakeNotification({Name = "☣ AutoPlayer ☣", Content = "Link DONATE has coppied paste to your browser ", Time = 3})
  1081. local args = {
  1082. [1] = workspace:WaitForChild("AllNPC"):WaitForChild("Elite Pirate")
  1083. }
  1084.  
  1085. game.ReplicatedStorage.Remotes.Functions.CheckQuest:InvokeServer(unpack(args))
  1086. print("Create GUI ")
  1087.  
  1088. end
  1089.  
  1090. })
  1091.  
  1092.  
  1093. --end o day-------------------
  1094. end
Add Comment
Please, Sign In to add comment