From 9ce9336d15149caeb4e94c24371cdbc89c433b86 Mon Sep 17 00:00:00 2001 From: RedyRT <64935439+RedyRT@users.noreply.github.com> Date: Fri, 28 Jul 2023 19:04:41 +0300 Subject: [PATCH] Update Checkpoints.lua Fixes lua errors when starting multiplayer --- beatrun/gamemodes/beatrun/gamemode/sh/Checkpoints.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Checkpoints.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Checkpoints.lua index 7a8be0f..537be7b 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Checkpoints.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Checkpoints.lua @@ -246,6 +246,8 @@ function CourseHUD() text = speed .. " km/h" local w, _ = surface.GetTextSize(text) + w = w or 0 + local r, g, b, a = string.ToColor(GetConVar("Beatrun_HUDTextColor"):GetString()) surface.SetDrawColor(255, 255, 255, 255) @@ -267,6 +269,8 @@ function CourseHUD() if timealpha > 0 then local w, _ = surface.GetTextSize(timetext) + w = w or 0 + timealpha = math.max(0, timealpha - FrameTime() * 250) timecolor.a = math.min(255, timealpha) @@ -362,4 +366,4 @@ net.Receive("BeatrunSpawn", function() if LocalPlayer().GetInfoNum then StartCourse(spawntime) end -end) \ No newline at end of file +end)