UPDATE! I figured out what was wrong. here's the code if anyone wants to borrow it.
-- Made by wookey12 :) --[[Warning this script only PRINTS the Stamina amount in the output (just for the newbies) ]] wait(1) local player = game.Players.LocalPlayer local mouse = game.Players.LocalPlayer:GetMouse() local KEYRELEASED = true mouse.KeyDown:connect(function(KeyDown) if KeyDown:byte() == 48 then KEYRELEASED = false game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30 for i = game.Workspace.StaminaVal.Value,1,-1 do print(i) game.Workspace.StaminaVal.Value = game.Workspace.StaminaVal.Value - 1 wait(.5) if i == 1 then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 end if KEYRELEASED == true then break end end end end) mouse.KeyUp:connect(function(KeyUp) if KeyUp:byte() == 48 then KEYRELEASED = true if KEYRELEASED == true then player.Character.Humanoid.WalkSpeed = 16 for i = game.Workspace.StaminaVal.Value,30,1 do print(i) game.Workspace.StaminaVal.Value = game.Workspace.StaminaVal.Value + 1 wait(.5) if KEYRELEASED == false then break end end end end end)
I don't know if this will help, but try this:
-- Made by wookey12 :) wait(1) local player = game.Players.LocalPlayer local mouse = game.Players.LocalPlayer:GetMouse() while wait() do if KeyDown:byte() == 48 then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30 for i = 30,1,-1 do if KeyDown == false then for i = i,30,1 do print(i) wait(.5) end end print(i) wait(.5) end else player.Character.Humanoid.WalkSpeed = 16 end end)
UPDATE! I found out what was wrong. Here is my code if anyone wants to borrow it :)
-- Made by wookey12 :) --[[Warning this script only PRINTS the Stamina amount in the output (just for the newbies) ]] wait(1) local player = game.Players.LocalPlayer local mouse = game.Players.LocalPlayer:GetMouse() local KEYRELEASED = true mouse.KeyDown:connect(function(KeyDown) if KeyDown:byte() == 48 then KEYRELEASED = false game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30 for i = game.Workspace.StaminaVal.Value,1,-1 do print(i) game.Workspace.StaminaVal.Value = game.Workspace.StaminaVal.Value - 1 wait(.5) if i == 1 then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 end if KEYRELEASED == true then break end end end end) mouse.KeyUp:connect(function(KeyUp) if KeyUp:byte() == 48 then KEYRELEASED = true if KEYRELEASED == true then player.Character.Humanoid.WalkSpeed = 16 for i = game.Workspace.StaminaVal.Value,30,1 do print(i) game.Workspace.StaminaVal.Value = game.Workspace.StaminaVal.Value + 1 wait(.5) if KEYRELEASED == false then break end end end end end)