Hello Scriptinghelpers, Im working on a sprinting script for my game ive ran into some problems and im not sure how im going to write this more efficently heres my code: ~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~stamina = 100 maxstamina = 100 sbar = script.Parent.Parent.PlayerGui.Bars.HpBarFrame.StaminaBar stext = script.Parent.Parent.PlayerGui.Bars.HpBarFrame.StaminaText devisionvalue = script.Parent.Parent.PlayerGui.Bars.HpBarFrame.dv.Value
--Functions function onKeyPress(actionName, userInputState, inputObject) print("Hook Still Works!") end
while true do --Stamina Bar sbar.Size = UDim2.new(stamina / devisionvalue,0,0, 20)
--Stamina Text stext.Text = "Stamina: " .. stamina .. "/" .. maxstamina wait(0.2)
end
--Hooks game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.LeftShift)~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
Help Would Be Appriciated, Thanks ScrappyHaxor