Ameno__GodOH

Jjs DownSlam

Aug 27th, 2024
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. -- Variável para controlar o cooldown (by mandy_dos_candys)
  2. local isCooldown = false
  3. local cooldownTime = 1 -- Tempo de espera em segundos
  4.  
  5. -- Função que executa o comando "Up" para qualquer personagem
  6. local function executeUpForAllCharacters()
  7. -- Verifica se ainda está em cooldown
  8. if isCooldown then
  9. return
  10. end
  11.  
  12. -- Inicia o cooldown
  13. isCooldown = true
  14.  
  15. local services = game:GetService("ReplicatedStorage").Knit.Knit.Services
  16.  
  17. for _, service in pairs(services:GetChildren()) do
  18. if service:FindFirstChild("RE") and service.RE:FindFirstChild("Activated") then
  19. local args = {
  20. [1] = "Down"
  21. }
  22. service.RE.Activated:FireServer(unpack(args))
  23. end
  24. end
  25.  
  26. -- Aguarda o tempo de cooldown antes de permitir outra execução
  27. task.wait(cooldownTime)
  28. isCooldown = false
  29. end
  30.  
  31. -- Função para criar o botão
  32. local function createButton()
  33. -- Remove o botão antigo se existir
  34. if game.Players.LocalPlayer.PlayerGui:FindFirstChild("UppercutButtonGui") then
  35. game.Players.LocalPlayer.PlayerGui.UppercutButtonGui:Destroy()
  36. end
  37.  
  38. -- Criação da interface do botão
  39. local ScreenGui = Instance.new("ScreenGui")
  40. local UICorner = Instance.new("UICorner")
  41. local TextButton = Instance.new("TextButton")
  42.  
  43. -- Configurações da interface
  44. ScreenGui.Name = "UppercutButtonGui"
  45. ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  46.  
  47. TextButton.Parent = ScreenGui
  48. TextButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20) -- Cor cinza mais escura
  49. TextButton.BackgroundTransparency = 0.5 -- Transparência (0.5 = 50% transparente)
  50. TextButton.Position = UDim2.new(1, -185, 0, 10) -- Posição mais à esquerda
  51. TextButton.Size = UDim2.new(0, 75, 0, 75) -- Tamanho menor do botão
  52. TextButton.Text = "DownSlam" -- Texto no botão
  53. TextButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- Cor do texto
  54. TextButton.TextScaled = true -- Escala do texto
  55.  
  56. -- Torna o botão redondo
  57. UICorner.CornerRadius = UDim.new(1, 0)
  58. UICorner.Parent = TextButton
  59.  
  60. -- Função para executar o script ao clicar no botão
  61. TextButton.MouseButton1Click:Connect(function()
  62. executeUpForAllCharacters()
  63. end)
  64. end
  65.  
  66. -- Conecta a função createButton ao evento CharacterAdded
  67. game.Players.LocalPlayer.CharacterAdded:Connect(createButton)
  68.  
  69. -- Cria o botão pela primeira vez
  70. createButton()
Advertisement
Add Comment
Please, Sign In to add comment