Why is this not changing the properties?

Hey, I am trying to make a timing system for a racing game, but this LocalScript doesn’t seem to be working. It manages to change the properties of Time1 & Lap1 completely fine, but not Time2 & Lap2. It also prints out “poop”

-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage")

-- RemoteEvents
local UpdateBoard = ReplicatedStorage:FindFirstChild("TimingEvents").UpdateBoard

-- OOP
local GUI = script.Parent
local TimingFrame = GUI.Frame.TimingFrame
local Template = TimingFrame.NameBoard

UpdateBoard.OnClientEvent:Connect(function(Player, Lap, Time)
	
	local PlayerBoard = TimingFrame.NameBoard:Clone() -- Add player to timing board
	local TimeUI = PlayerBoard.Times
	
	if Lap == "Lap1" then -- Display lap 1
		PlayerBoard.Name = Player
		PlayerBoard.Times.Username.Text = tostring(Player)
		PlayerBoard.Parent = TimingFrame
		PlayerBoard.Visible = true
		
		TimeUI.Time1.Text = tostring(Time)
		TimeUI.Lap1.BackgroundColor3 = Color3.new(0, 255, 0)
		TimeUI.Time1.Visible = true
		
	elseif Lap == "Lap2" then -- Display lap 2
		TimeUI.Time2.Text = tostring(Time)
		TimeUI.Lap2.BackgroundColor3 = Color3.new(0, 255, 0)
		TimeUI.Time2.Visible = true
	end
	
end)
1 Like

Did you fire the event only once with “Lap1”? Then it won’t work since the elseif statement won’t run since it’s false.

1 Like

Make sure the the server is firing to all clients when the race starts/the timer resets using event:FireAllClients(). If a player needs to update their own score/timer, they should be firing to the server to do the necessary checks and then the server should fire the necessary info back to the clients again

Hi, I fired the event with lap2 and lap1

Hi, I did use FireAllClients()