function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.RightControl then
if Frame.Visible == false then
Frame.Visible = true
else
Frame.Visible = false
end
end
end
local userInput = game:GetService("UserInputService")
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local frame = script.Parent
local textBox = frame:WaitForChild("TextBox")
local textButton = frame:WaitForChild("TextButton")
local speedValue = player:FindFirstChild("SpeedValue")
if not speedValue then
speedValue = Instance.new("IntValue")
speedValue.Name = "SpeedValue"
speedValue.Value = 16
speedValue.Parent = player
end
humanoid.WalkSpeed = speedValue.Value
textButton.MouseButton1Click:Connect(function()
if textBox.Text:len() > 0 then
local number = tonumber(textBox.Text)
if number then
if number < 100 then
humanoid.WalkSpeed = number
speedValue.Value = number
end
end
end
end)
userInput.InputBegan:Connect(function(inputObject, gameProcessedEvent)
if gameProcessedEvent then return end
if inputObject.KeyCode == Enum.KeyCode.RightControl then
frame.Visible = not frame.Visible
end
end)
Here’s a working version of your script with some structural/logic changes implemented, I’ll attach a model file below so you can download the resource.