Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variável para controlar o cooldown (by mandy_dos_candys)
- local isCooldown = false
- local cooldownTime = 1 -- Tempo de espera em segundos
- -- Função que executa o comando "Up" para qualquer personagem
- local function executeUpForAllCharacters()
- -- Verifica se ainda está em cooldown
- if isCooldown then
- return
- end
- -- Inicia o cooldown
- isCooldown = true
- local services = game:GetService("ReplicatedStorage").Knit.Knit.Services
- for _, service in pairs(services:GetChildren()) do
- if service:FindFirstChild("RE") and service.RE:FindFirstChild("Activated") then
- local args = {
- [1] = "Down"
- }
- service.RE.Activated:FireServer(unpack(args))
- end
- end
- -- Aguarda o tempo de cooldown antes de permitir outra execução
- task.wait(cooldownTime)
- isCooldown = false
- end
- -- Função para criar o botão
- local function createButton()
- -- Remove o botão antigo se existir
- if game.Players.LocalPlayer.PlayerGui:FindFirstChild("UppercutButtonGui") then
- game.Players.LocalPlayer.PlayerGui.UppercutButtonGui:Destroy()
- end
- -- Criação da interface do botão
- local ScreenGui = Instance.new("ScreenGui")
- local UICorner = Instance.new("UICorner")
- local TextButton = Instance.new("TextButton")
- -- Configurações da interface
- ScreenGui.Name = "UppercutButtonGui"
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- TextButton.Parent = ScreenGui
- TextButton.BackgroundColor3 = Color3.fromRGB(20, 20, 20) -- Cor cinza mais escura
- TextButton.BackgroundTransparency = 0.5 -- Transparência (0.5 = 50% transparente)
- TextButton.Position = UDim2.new(1, -185, 0, 10) -- Posição mais à esquerda
- TextButton.Size = UDim2.new(0, 75, 0, 75) -- Tamanho menor do botão
- TextButton.Text = "DownSlam" -- Texto no botão
- TextButton.TextColor3 = Color3.fromRGB(255, 255, 255) -- Cor do texto
- TextButton.TextScaled = true -- Escala do texto
- -- Torna o botão redondo
- UICorner.CornerRadius = UDim.new(1, 0)
- UICorner.Parent = TextButton
- -- Função para executar o script ao clicar no botão
- TextButton.MouseButton1Click:Connect(function()
- executeUpForAllCharacters()
- end)
- end
- -- Conecta a função createButton ao evento CharacterAdded
- game.Players.LocalPlayer.CharacterAdded:Connect(createButton)
- -- Cria o botão pela primeira vez
- createButton()
Advertisement
Add Comment
Please, Sign In to add comment