TEXT 154
Dragon Soul New Script By venuslock on 30th July 2024 12:31:10 PM
  1. --  â–ˆâ–ˆâ–“███  â–“█████  â–ˆâ–ˆâ–ˆâ–„    â–ˆ   ▄████  â–ˆ    â–ˆâ–ˆ  â–ˆ    â–ˆâ–ˆ  â–â–ˆâ–ˆâ–Œ  â–â–ˆâ–ˆâ–Œ
  2. --  â–“██░  â–ˆâ–ˆâ–’â–“â–ˆ   â–€  â–ˆâ–ˆ ▀█   â–ˆ  â–ˆâ–ˆâ–’ ▀█▒ ██  â–“██▒ ██  â–“██▒ ▐██▌  â–â–ˆâ–ˆâ–Œ
  3. --  â–“██░ ██▓▒▒███   ▓██  â–€â–ˆ ██▒▒██░▄▄▄░▓██  â–’██░▓██  â–’██░ ▐██▌  â–â–ˆâ–ˆâ–Œ
  4. --  â–’██▄█▓▒ â–’â–’â–“â–ˆ  â–„ ▓██▒  â–â–Œâ–ˆâ–ˆâ–’â–‘â–“â–ˆ  â–ˆâ–ˆâ–“â–“â–“â–ˆ  â–‘██░▓▓█  â–‘██░ ▓██▒  â–“██▒
  5. --  â–’██▒ â–‘  â–‘░▒████▒▒██░   ▓██░░▒▓███▀▒▒▒█████▓ ▒▒█████▓  â–’â–„â–„   â–’â–„â–„  
  6. --  â–’â–“â–’â–‘ â–‘  â–‘â–‘â–‘ â–’â–‘ â–‘â–‘ â–’â–‘   â–’ â–’  â–‘â–’   â–’ â–‘â–’â–“â–’ â–’ â–’ â–‘â–’â–“â–’ â–’ â–’  â–‘▀▀▒  â–‘▀▀▒
  7. --  â–‘â–’ â–‘      â–‘ â–‘  â–‘â–‘ â–‘â–‘   â–‘ â–’â–‘  â–‘   â–‘ â–‘â–‘â–’â–‘ â–‘ â–‘ â–‘â–‘â–’â–‘ â–‘ â–‘  â–‘  â–‘  â–‘  â–‘
  8. --  â–‘â–‘          â–‘      â–‘   â–‘ â–‘ â–‘ â–‘   â–‘  â–‘â–‘â–‘ â–‘ â–‘  â–‘â–‘â–‘ â–‘ â–‘     â–‘     â–‘
  9. --              â–‘  â–‘         â–‘       â–‘    â–‘        â–‘      â–‘     â–‘  
  10.  
  11. local freezeEntityToggle = true
  12. local attackEntityToggle = true
  13. local keybind = Enum.KeyCode.E
  14.  
  15. local continueAttacking = false
  16.  
  17. local function calculateDistance(pos1, pos2)
  18.     return (pos1 - pos2).Magnitude
  19. end
  20.  
  21. local function freezeEntity(entity)
  22.     if not freezeEntityToggle then return end
  23.     for _, part in pairs(entity:GetChildren()) do
  24.         if part:IsA("BasePart") then
  25.             part.Anchored = true
  26.         end
  27.     end
  28. end
  29.  
  30. local function toggleAttack()
  31.     continueAttacking = not continueAttacking
  32. end
  33.  
  34. local function getEntityNames()
  35.     local entityNames = {}
  36.     for _, entity in pairs(workspace.Main.Live:GetChildren()) do
  37.         if entity:IsA("Model") then
  38.             table.insert(entityNames, entity.Name)
  39.         end
  40.     end
  41.     return entityNames
  42. end
  43.  
  44. local function onKeyPress(input)
  45.     if input.KeyCode == keybind then
  46.         toggleAttack()
  47.     end
  48. end
  49.  
  50. game:GetService("UserInputService").InputBegan:Connect(onKeyPress)
  51.  
  52. local entityNames = {}
  53. spawn(function()
  54.     while wait(1) do
  55.         entityNames = getEntityNames()
  56.     end
  57. end)
  58.  
  59. while wait(0.1) do
  60.     if not continueAttacking then
  61.         continue
  62.     end
  63.    
  64.     local player = game.Players.LocalPlayer
  65.     local playerPosition = player.Character and player.Character:FindFirstChild("HumanoidRootPart") and player.Character.HumanoidRootPart.Position
  66.    
  67.     if not playerPosition then
  68.         return
  69.     end
  70.  
  71.     for _, entity in pairs(workspace.Main.Live:GetChildren()) do
  72.         if table.find(entityNames, entity.Name) and entity ~= game.Players.LocalPlayer.Character then
  73.             local entityRootPart = entity:FindFirstChild("HumanoidRootPart")
  74.            
  75.             if entityRootPart then
  76.                 local entityPosition = entityRootPart.Position
  77.                 local distance = calculateDistance(playerPosition, entityPosition)
  78.  
  79.                 if distance <= 20 then
  80.                     if freezeEntityToggle then
  81.                         freezeEntity(entity)
  82.                     end
  83.                    
  84.                     if attackEntityToggle then
  85.                         local args = {
  86.                             [1] = {
  87.                                 ["Victim"] = entity,
  88.                                 ["Type"] = "Light",
  89.                                 ["LocalInfo"] = {
  90.                                     ["Flying"] = false
  91.                                 },
  92.                                 ["CurrentHeavy"] = 1,
  93.                                 ["CurrentLight"] = 2,
  94.                                 ["CurrentLightCombo"] = 1,
  95.                                 ["VictimPosition"] = entityPosition,
  96.                                 ["AnimSet"] = "Generic"
  97.                             }
  98.                         }
  99.                        
  100.                         game:GetService("ReplicatedStorage").Events.TryAttack:FireServer(unpack(args))
  101.                     end
  102.                 end
  103.             end
  104.         end
  105.     end
  106. end

Texbin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.