Ameno__GodOH

Move speed script

Jun 8th, 2024 (edited)
1,986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. -- Cria a GUI
  2. local screenGui = Instance.new("ScreenGui")
  3. screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
  4.  
  5. -- Cria o frame principal
  6. local frame = Instance.new("Frame")
  7. frame.Size = UDim2.new(0.3, 0, 0.3, 0)
  8. frame.Position = UDim2.new(0.35, 0, 0.35, 0)
  9. frame.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
  10. frame.Active = true
  11. frame.Draggable = true
  12. frame.Parent = screenGui
  13.  
  14. -- Cria o rótulo de crédito
  15. local creditLabel = Instance.new("TextLabel")
  16. creditLabel.Size = UDim2.new(1, 0, 0.1, 0)
  17. creditLabel.Position = UDim2.new(0, 0, 0, 0)
  18. creditLabel.Text = "by: mandy_dos_candys"
  19. creditLabel.TextColor3 = Color3.fromRGB(0, 0, 0)
  20. creditLabel.BackgroundTransparency = 1
  21. creditLabel.TextSize = 12 -- Aumenta o tamanho da fonte
  22. creditLabel.Parent = frame
  23.  
  24. -- Cria o TextBox para inserir a velocidade
  25. local textBox = Instance.new("TextBox")
  26. textBox.Size = UDim2.new(0.8, 0, 0.2, 0)
  27. textBox.Position = UDim2.new(0.1, 0, 0.3, 0)
  28. textBox.PlaceholderText = "Insira a nova velocidade"
  29. textBox.Text = ""
  30. textBox.Parent = frame
  31.  
  32. -- Cria o botão para aplicar a velocidade
  33. local button = Instance.new("TextButton")
  34. button.Size = UDim2.new(0.8, 0, 0.2, 0)
  35. button.Position = UDim2.new(0.1, 0, 0.6, 0)
  36. button.Text = "Aplicar Velocidade"
  37. button.Parent = frame
  38.  
  39. -- Função para atualizar a velocidade de caminhada
  40. local function atualizarVelocidade()
  41. local novaVelocidade = tonumber(textBox.Text)
  42. if novaVelocidade and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") then
  43. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = novaVelocidade
  44. else
  45. -- Feedback básico para o jogador em caso de erro
  46. textBox.Text = "Valor inválido!"
  47. end
  48. end
  49.  
  50. -- Conecta a função ao botão
  51. button.MouseButton1Click:Connect(atualizarVelocidade)
  52.  
  53. -- Cria o botão de fechar
  54. local closeButton = Instance.new("TextButton")
  55. closeButton.Size = UDim2.new(0.1, 0, 0.1, 0)
  56. closeButton.Position = UDim2.new(0.9, -25, 0, 0)
  57. closeButton.Text = "x"
  58. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  59. closeButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
  60. closeButton.Parent = frame
  61.  
  62. -- Função para fechar o frame
  63. local function fecharFrame()
  64. frame.Visible = false
  65. end
  66.  
  67. -- Conecta a função ao botão de fechar
  68. closeButton.MouseButton1Click:Connect(fecharFrame)
Advertisement
Add Comment
Please, Sign In to add comment