Advertisement
yDarkzin

Defense Until Death Simulator Hit Box

Jan 12th, 2024 (edited)
1,525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---Defense Until Death Simulator Script Auto Hit Box
  2. -- Find the player's character
  3. local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
  4.  
  5. -- Find the humanoid inside the character
  6. local humanoid = character:WaitForChild("Humanoid")
  7.  
  8. -- Function to run when the player dies
  9. local function onPlayerDied()
  10.    print("Player has died!")
  11. game:GetService("StarterGui"):SetCore("SendNotification", {
  12.    Title = "A mensagem de yDarkzin",
  13.    Text = "A Gui foi destruída, por favor reinicie a Gui",
  14.    Duration = 9
  15. })
  16. end
  17.  
  18. -- Connect the function to the Died event
  19. humanoid.Died:Connect(onPlayerDied)
  20.  
  21. game:GetService("StarterGui"):SetCore("SendNotification", {
  22.    Title = "A mensagem de yDarkzin",
  23.    Text = "Script loaded obrigado por usar meu script.",
  24.    Duration = 9
  25. })
  26. local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/xHeptc/Kavo-UI-Library/main/source.lua"))()
  27. local Window = Library.CreateLib("Defense Until Death Simulator", "DarkTheme")
  28. local Tab = Window:NewTab("Functions")
  29. local Section = Tab:NewSection("Monster Attacking")
  30. Section:NewButton("AutoHit (GUI)", "ButtonInfo", function()
  31. game:GetService("StarterGui"):SetCore("SendNotification", {
  32.    Title = "A mensagem de yDarkzin",
  33.    Text = "Auto Hit Box Gui Loaded",
  34.    Duration = 9
  35. })
  36.  
  37. -- Define the GUI
  38. local gui = Instance.new("ScreenGui")
  39. gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  40. gui.Name = "1612dbxafg-bw1562512-xbwabxg18461"
  41.  
  42.  
  43. -- Define the toggle function
  44. local toggleEnabled = false
  45. local function toggleFunction()
  46.    if toggleEnabled then
  47.        print("Toggle is now OFF")
  48.        toggleEnabled = false
  49. game:GetService("StarterGui"):SetCore("SendNotification", {
  50.    Title = "A mensagem de yDarkzin",
  51.    Text = "Função Auto Hit Box (OFF)",
  52.    Duration = 5
  53. })
  54.    else
  55.        print("Toggle is now ON")
  56.        toggleEnabled = true
  57. game:GetService("StarterGui"):SetCore("SendNotification", {
  58.    Title = "A mensagem de yDarkzin",
  59.    Text = "Função Auto Hit Box (ON)",
  60.    Duration = 5
  61. })
  62.    end
  63. end
  64.  
  65.  
  66. local toggleButton = Instance.new("TextButton")
  67. toggleButton.Name = "ToggleButton"
  68. toggleButton.Text = "Toggle ON/OFF"
  69. toggleButton.Position = UDim2.new(0, 10, 0, 10)
  70. toggleButton.Size = UDim2.new(0, 200, 0, 50)
  71. toggleButton.Font = Enum.Font.SourceSansBold
  72. toggleButton.TextSize = 18
  73. toggleButton.Parent = gui
  74.  
  75. -- Connect the toggleButton to toggle the on/off state
  76. toggleButton.MouseButton1Click:Connect(function()
  77.    toggleFunction()
  78. end)
  79.  
  80. -- Check the toggleEnabled state each frame
  81. game:GetService("RunService").RenderStepped:Connect(function()
  82.    if toggleEnabled then
  83. game:GetService("ReplicatedStorage").MQTT.battle.AttackHitEvent:FireServer()
  84.    end
  85. end)
  86.  
  87. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement