local UserInputService = game:GetService("UserInputService")
local btn = script.Parent
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
-- A sample function providing one usage of InputBegan
local function onInputBegan(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.LeftShift then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 26
btn.BackgroundColor3 = Color3.new(0.0352941, 0.972549, 0.458824)
end
end
local function onInputEnded(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.LeftShift then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
btn.BackgroundColor3 = Color3.new(0.12549, 0.207843, 0.972549)
end
end
local function bten()
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 26
btn.BackgroundColor3 = Color3.new(0.0352941, 0.972549, 0.458824)
end
UserInputService.InputBegan:Connect(onInputBegan)
UserInputService.InputEnded:Connect(onInputEnded)
btn.Activated:Connect(bten)
I made a little sprinting script that get's inserted in the clients during a round. And get's deleted when round ends. AFTER I delete it I set the speed of the players to 16 again but it doesn't work

1 comment
thanks. I solved the problem right after posting. But thanks anyway