Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Place this LocalScript in a ScreenGui in StarterGui
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- -- Create the GUI button
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local button = Instance.new("TextButton")
- button.Size = UDim2.new(0, 200, 0, 50)
- button.Position = UDim2.new(0.5, -100, 0.5, -25)
- button.Text = "Change Speed"
- button.Parent = screenGui
- -- Function to change speed
- local function changeSpeed()
- local newSpeed = 50 -- Change this value to your desired speed
- humanoid.WalkSpeed = newSpeed
- end
- -- Connect button click to function
- button.MouseButton1Click:Connect(changeSpeed)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement