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 os scripts fornecidos
- local function executeScripts()
- -- Verifica se ainda está em cooldown
- if isCooldown then
- return
- end
- -- Inicia o cooldown
- isCooldown = true
- -- Executa o script de KeyPress (pressiona a barra de espaço)
- local keyPressArgs = {
- [1] = {
- ["Goal"] = "KeyPress",
- ["Key"] = Enum.KeyCode.Space
- }
- }
- game:GetService("Players").LocalPlayer.Character.Communicate:FireServer(unpack(keyPressArgs))
- -- Executa o script de LeftClick (simula um clique esquerdo)
- local leftClickArgs = {
- [1] = {
- ["Mobile"] = true,
- ["Goal"] = "LeftClick"
- }
- }
- game:GetService("Players").LocalPlayer.Character.Communicate:FireServer(unpack(leftClickArgs))
- -- Aguarda o tempo de execução
- task.wait(1)
- -- Para a execução do script após 1 segundo
- 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(30, 30, 30) -- 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 = "Uppercut" -- 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 os scripts ao clicar no botão
- TextButton.MouseButton1Click:Connect(function()
- executeScripts()
- 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