-- Sprint Key Pressed
userInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
replicatedStorage.RemoteEvents.Sprint:FireServer("Began")
end
end)
-- Sprint Key Released
userInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
replicatedStorage.RemoteEvents.Sprint:FireServer("Ended")
end
end)
-- Update Stamina GUI
replicatedStorage.RemoteEvents.StaminaUpdate.OnClientEvent:Connect(function(stamina, maxStamina)
players.LocalPlayer.PlayerGui.Stamina.Bar.Size = UDim2.new((stamina / maxStamina) * .971, 0, .247, 0)
end
the error is : Expected ')' (to close '(' at line 20), got <eof> -

3 comments
18 end change to end) because you are in connect
lehoaiquoc248@ That's not quite the answer. The error indicates an end is missing in a function RBXScriptConnection . Function is the argument its taking, and requires an end) in line 20 . The error means that the end is unclosed to a function. :Connect has nothing to do with the error.
:Connect doesn't return an end only functions like if statements, loops (exception of repeat loops)