stamina = 100
local user = game:GetService("UserInputService")
local key = Enum.KeyCode.Q
local keyheld = false
function OnInput(inputObject, gameprocessedevent)
if inputObject.UserInputState == Enum.UserInputState.Begin then
if inputObject.KeyCode == key and keyheld == false then
keyheld = true
if keyheld == true then
print (stamina)
if inputObject.UserInputState == Enum.UserInputState.End
then
keyheld = false
if keyheld == true then
stamina = stamina - 10
if stamina < 100 then
wait(10)
do
stamina = stamina + 10
if stamina == 100
then
end
user.InputBegan:Connect(OnInput)
user.InputEnded:Connect(OnInput)
end
end
end
end
end
end
end
end
When i press Q the script dosent print the stamina value what am i doing wrong?

3 comments
what do u do huh? fix it!
Fixed indentation.
I don't understand your question much. Can you explain what you are trying to do