Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

stamina breaking when i let go of shift?

Asked by
KNOSIS 8
5 years ago
Edited 5 years ago

when ever i click shift everything goes fine, but when i let go of shift i want the stamina to regen, and i want to be able to run at anytime as long as the stamina is above 0, but when i let go, i cant run anymore, i know i am doing something wrong.

01---sprtsp = sprint speed
02---regspd = regular speed
03---maxstam = max stanima
04 
05 
06 
07 
08 
09 
10--- Vars
11local plr = game.Players.LocalPlayer
12local char = plr.Character
13local hum = char.Humanoid
14local sprtspd = 30
15local regspd = 16
View all 64 lines...

1 answer

Log in to vote
0
Answered by 5 years ago

Just a simple problem of not setting the debounce back to false :) (letgo)

01---sprtsp = sprint speed
02---regspd = regular speed
03---maxstam = max stanima
04--- Vars
05local plr = game.Players.LocalPlayer
06local char = plr.Character
07local hum = char:WaitForChild("Humanoid")
08local sprtspd = 30
09local regspd = 16
10local maxstam = 100
11uis = game:GetService("UserInputService")
12letgo = false
13------------------------------------
14uis.InputBegan:connect(function(input)
15    letgo = false -- here
View all 45 lines...
Ad

Answer this question