Artani

LEGACY PIECE

Jul 11th, 2022
1,226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.34 KB | None | 0 0
  1. getgenv().KillAll = true
  2. --[[
  3.     Made by Guilder#9476
  4.     Was published in Synapse X discord
  5.     Free to use,
  6.     Status as 10/07/22: working
  7.     Game Link: https://www.roblox.com/games/8123652942/UPDATE-0-5-Legend-Piece#!/game-instances
  8. --]]
  9.  
  10.  
  11. local Quests = require(game:GetService("ReplicatedStorage").Informations).Mob
  12.  
  13. local function Quest()
  14.     for i,v in next, Quests do
  15.         if tostring(i) ~= "MobNum" and tostring(i) ~= "SeaBeast" and tostring(i) ~= "SeaSoldier" and tostring(i) ~= "DarkPirate" then
  16.             if game:GetService("Players").LocalPlayer.Data.Level.Value >= v.QuestLevel then
  17.                 Mob = v.Name
  18.                 break
  19.             end
  20.         end
  21.     end
  22.     if Mob ~= nil then
  23.         game:GetService("ReplicatedStorage").Remotes.NPC:FireServer("Quest", Mob)
  24.         game.Players.LocalPlayer.PlayerGui:WaitForChild("QuestGui").Frame.Accept.RemoteEvent:FireServer()
  25.         repeat
  26.             task.wait()
  27.         until game:GetService("Players").LocalPlayer.PlayerGui.QuestBar.MainFrame.Visible
  28.     end
  29. end
  30.  
  31. while getgenv().KillAll do task.wait()
  32.     if not game:GetService("Players").LocalPlayer.PlayerGui.QuestBar.MainFrame.Visible then
  33.         Quest()
  34.     end
  35.     if #game:GetService("Workspace").Monster:GetChildren() > 0 then
  36.         for i,v in next, game:GetService("Workspace").Monster:GetChildren() do
  37.             if v ~= nil and v:FindFirstChild("HumanoidRootPart") and v:FindFirstChild("Humanoid") and v.Name == game:GetService("Players").LocalPlayer.PlayerGui.QuestBar.MainFrame.Frame.Defeat.Text:split(" ")[3] and v.Humanoid.Health > 0 then
  38.                 local WasTime = os.time()
  39.                 repeat
  40.                     game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(v.HumanoidRootPart.Position - Vector3.new(0, 7, 0),  v.HumanoidRootPart.Position)
  41.                     game:GetService("ReplicatedStorage").Remotes.DamageRemoteEvent:FireServer("Damage1", {
  42.                         position = v.HumanoidRootPart.Position,
  43.                         damage = v.Humanoid.Health,
  44.                         max = 15,
  45.                         weapon = "Combat"
  46.                     })
  47.                     task.wait()
  48.                 until v == nil or not v:FindFirstChild("Humanoid") or v.Humanoid.Health <= 0 or os.time() - WasTime > 2
  49.             end
  50.         end
  51.     end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment