-- 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> -
The error indicates that an end is missing from a function, and in this case, it'd be line 20, based on the error line.
On line 20, there's no end) function to end the argument list of :Connect
.
Theend)
is a callback from the argument, since it ends that function with a closing parenthesis.
All you have to do is add an end)
on line 20. Since that's where the error line in the output is stating.
-- 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)
Reference:
RBXScriptConnection - API Documentation