ADVERTISEMENTREMOVE ADS
Speed changer limit 1000
46,799 views
Universal script•
3 months ago

Script Preview
Description
The script changes your speed
Tested with
ADVERTISEMENTREMOVE ADS
124 Lines • 4.75 KiB
-- Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
-- Get the local player and their character
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
local PlayerMouse = LocalPlayer:GetMouse()
-- List of predefined speeds to cycle through
local speeds = {16, 50, 100, 250, 500, 1000}
local currentSpeedIndex = 1
local savedSpeed = 16 -- This variable will save your speed across respawns
-- Create the main ScreenGui for the interface
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "SpeedController"
screenGui.Parent = LocalPlayer:WaitForChild("PlayerGui")
screenGui.ResetOnSpawn = false -- This makes the GUI stay where it is when you respawn
-- Create the main frame to hold the UI elements
local mainFrame = Instance.new("Frame")
mainFrame.Size = UDim2.new(0, 250, 0, 150)
mainFrame.Position = UDim2.new(0.5, -125, 0.5, -75)
mainFrame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
mainFrame.BorderColor3 = Color3.fromRGB(20, 20, 20)
mainFrame.Parent = screenGui
mainFrame.Active = true
mainFrame.Draggable = true -- This makes the frame movable
-- Create a label to display the currently selected speed
local speedLabel = Instance.new("TextLabel")
speedLabel.Size = UDim2.new(1, 0, 0.2, 0)
speedLabel.Position = UDim2.new(0, 0, 0, 5)
speedLabel.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
speedLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
speedLabel.Text = "Selected Speed: 16"
speedLabel.Font = Enum.Font.SourceSansBold
speedLabel.TextSize = 18
speedLabel.Parent = mainFrame
-- Create the button to change the speed
local changeSpeedButton = Instance.new("TextButton")
changeSpeedButton.Name = "ChangeSpeedButton"
changeSpeedButton.Size = UDim2.new(0.8, 0, 0.25, 0)
changeSpeedButton.Position = UDim2.new(0.1, 0, 0.25, 0)
changeSpeedButton.BackgroundColor3 = Color3.fromRGB(0, 170, 255)
changeSpeedButton.TextColor3 = Color3.fromRGB(255, 255, 255)
changeSpeedButton.Text = "Change Speed"
changeSpeedButton.Font = Enum.Font.SourceSansBold
changeSpeedButton.TextSize = 18
changeSpeedButton.Parent = mainFrame
-- Create the button to activate the selected speed
local activateButton = Instance.new("TextButton")
activateButton.Name = "ActivateButton"
activateButton.Size = UDim2.new(0.8, 0, 0.25, 0)
activateButton.Position = UDim2.new(0.1, 0, 0.55, 0)
activateButton.BackgroundColor3 = Color3.fromRGB(85, 255, 0)
activateButton.TextColor3 = Color3.fromRGB(255, 255, 255)
activateButton.Text = "Activate Speed"
activateButton.Font = Enum.Font.SourceSansBold
activateButton.TextSize = 18
activateButton.Parent = mainFrame
-- Create the button to deactivate the speed
local deactivateButton = Instance.new("TextButton")
deactivateButton.Name = "DeactivateButton"
deactivateButton.Size = UDim2.new(0.8, 0, 0.25, 0)
deactivateButton.Position = UDim2.new(0.1, 0, 0.85, 0)
deactivateButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
deactivateButton.TextColor3 = Color3.fromRGB(255, 255, 255)
deactivateButton.Text = "Deactivate Speed"
deactivateButton.Font = Enum.Font.SourceSansBold
deactivateButton.TextSize = 18
deactivateButton.Parent = mainFrame
-- Function to change the displayed speed
changeSpeedButton.Activated:Connect(function()
currentSpeedIndex = currentSpeedIndex + 1
if currentSpeedIndex > #speeds then
currentSpeedIndex = 1
end
local selectedSpeed = speeds[currentSpeedIndex]
speedLabel.Text = "Selected Speed: " .. selectedSpeed
end)
-- Function to activate the speed on the player's character
activateButton.Activated:Connect(function()
local humanoid = Character:FindFirstChildOfClass("Humanoid")
if humanoid then
local newSpeed = speeds[currentSpeedIndex]
humanoid.WalkSpeed = newSpeed
savedSpeed = newSpeed -- Save the speed so it's not lost on death
end
end)
-- Function to deactivate the speed and return to default
deactivateButton.Activated:Connect(function()
local humanoid = Character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = 16
speedLabel.Text = "Selected Speed: 16"
currentSpeedIndex = 1
savedSpeed = 16 -- Reset the saved speed to the default
end
end)
-- This part is new: it makes sure your speed is reapplied when you respawn
LocalPlayer.CharacterAdded:Connect(function(newCharacter)
-- Update the character variable to the new character
Character = newCharacter
-- Wait for the Humanoid to be added to the new character
local humanoid = newCharacter:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.WalkSpeed = savedSpeed
else
-- This waits for the humanoid to be added if it's not there right away
newCharacter:WaitForChild("Humanoid").WalkSpeed = savedSpeed
end
end)
ADVERTISEMENTREMOVE ADS
ADVERTISEMENTREMOVE ADS






Comments
I used AI to do this. I’ve made a second one that has a button so you can close and open.
hi new script