I am running into a problem on my sprinting script. Or the stamina part of it. I keep getting this error: "19:43:24.258 - Players.DAKNCAMGAMING.PlayerScripts.SprintHandler:16: Incomplete statement: expected assignment or a function call"
Here is my script:
local uis = game:GetService('UserInputService')
local players = game:GetService('Players')
local player = players.LocalPlayer
local runStatus = false
local walkSpeedMultiplyer = 2
local originalWalkSpeed = 16
local currentStamina = 500
local maximumStamina = 500
local runningStaminaCost = 5
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift and player.Character.Humanoid:GetState() == Enum.HumanoidStateType.RunningNoPhysics and currentStamina >= 0 then
runStatus = true
player.Character.Humanoid.WalkSpeed = player.Character.Humanoid.WalkSpeed * walkSpeedMultiplyer
currentStamina - runningStaminaCost until currentStamina == 0
end
end)
uis.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
player.Character.Humanoid.WalkSpeed = originalWalkSpeed
end
end)
