Ameno__GodOH

anti hao haki

Aug 4th, 2024
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. -- Script Local (colocar em LocalPlayer)
  2. local Players = game:GetService("Players")
  3. local LocalPlayer = Players.LocalPlayer
  4. local RunService = game:GetService("RunService")
  5.  
  6. -- Função para tentar bloquear o evento remoto
  7. local function blockRemoteEvent()
  8. local backpack = LocalPlayer:WaitForChild("Backpack")
  9. local haoshoku = backpack:FindFirstChild("Haoshoku")
  10.  
  11. if haoshoku and haoshoku:FindFirstChild("Remote") and haoshoku.Remote:FindFirstChild("Haki_Event") then
  12. local remoteEvent = haoshoku.Remote.Haki_Event
  13.  
  14. -- Desconectar todas as conexões do evento remoto
  15. for _, connection in pairs(getconnections(remoteEvent.OnClientEvent)) do
  16. connection:Disable()
  17. end
  18.  
  19. -- Alternativamente, substituir o comportamento do evento remoto
  20. remoteEvent.OnClientEvent:Connect(function()
  21. print("Evento remoto Haki_Event bloqueado.")
  22. end)
  23. end
  24. end
  25.  
  26. -- Função para garantir que o personagem não seja imobilizado
  27. local function ensureCharacterState()
  28. local character = LocalPlayer.Character
  29. if character and character:FindFirstChildOfClass("Humanoid") then
  30. local humanoid = character:FindFirstChildOfClass("Humanoid")
  31. -- Garantir que o humanoid não esteja em estado de queda ou imobilização
  32. if humanoid.PlatformStand then
  33. humanoid.PlatformStand = false
  34. end
  35. if humanoid.Sit then
  36. humanoid.Sit = false
  37. end
  38. end
  39. end
  40.  
  41. -- Loop para verificar constantemente o evento remoto e o estado do personagem
  42. RunService.RenderStepped:Connect(function()
  43. blockRemoteEvent()
  44. ensureCharacterState()
  45. end)
  46.  
  47. -- Também conectar ao evento de respawn do personagem para aplicar as proteções
  48. LocalPlayer.CharacterAdded:Connect(function(character)
  49. character:WaitForChild("Humanoid").Died:Connect(function()
  50. -- Reaplicar as proteções quando o personagem morrer
  51. RunService.RenderStepped:Connect(function()
  52. blockRemoteEvent()
  53. ensureCharacterState()
  54. end)
  55. end)
  56. end)
Advertisement
Add Comment
Please, Sign In to add comment