I'm sorry for the inconvenience, I have released I had many spelling errors, and other errors. I've fixed those mistakes, though there is still a problem. It says that I need to close my function on line 32... I did..? Btw, I changed the localscript below.
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local players = game:GetService("Players")
local inputService = game:GetService("UserInputService")
local player = players.LocalPlayer
local character = playerCharacter or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
local stamina = 100
local Interface = {}
do
local playerGui = player:WaitForChild("PlayerGui")
local gui = playerGui:WaitForChild("Stamina")
local frame = gui:WaitForChild("Frame")
local textlabel = frame:WaitForChild("TextLabel")
local bar = frame:WaitForChild("Percentage")
local UDim2_new = UDim2.new
function Interface:UpdateStamina()
bar.Size = UDim2_new(stamina/100, 0, 0, 0)
textLabel.Text = ("Stamina - 4d / 100")format(stamina)
end
end
inputService.InputBegan:connect(function(input, event)
if (event or stamina <= 0) then return end
local key = input.KeyCode.Name
print(key)
if (key == "LeftControl") then
humanoid.Walkspeed = 26
repeat
if (humanoid.MoveDirection.Magnitude > 0.1) then
stamina = stamina - 1
Interface:UpdateStamina()
end
wait(0)
until not inputService:IsKeyDown(Enum.KeyCode.LeftControl) do
humanoid.WalkSpeed = script.Parent.Parent.Humanoid.Walkspeed
if (stamina <= 0) then
wait(3)
else
wait(1)
end
while (not inputService:isKeyDown(Enum.KeyCode.LeftControl)and stamina >= 100) do
stamina = stamina + 0.1
Interface:UpdateStamina()
wait(0)
end
end
end

8 comments
Are you sure it's not line 6 where you have players:LocalPlayer instead of players.LocalPlayer?
uhh lemme see
oh, no when i replaced the : with . it gave me another error at line 46 where it has ))
You shouldn't do this on the client entirely because people can hack it. Update it on the client, manage the stamina on the server.
What is the actual error? 'output says there is something wrong with the 7th line' isn't very descriptive.
i dont know how to do that, and also the erorr is on line 7 it says, "Expected '(', '{' or got 'local'"
idk what to do when it does that
Added an answer based on the output.