Server to client side help

The thing im working on is a simple counter that adds across all players screens. My problem is the command /add is only client side and doesnt change the counter number (num) for all players. Is there anyway to make it so you type /add on a server side command and it change the (num) value on the client side. (im new to scripting so the server events still confuse me)

local color = {
    r=255,
    g=0,
    b=75,
    a=255
}

local num = 0

RegisterCommand('add', function(math, source)
    num = num + 1
end)

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(1)
        SetTextFont(0) -- 0-4
        SetTextScale(0.4, 0.4) -- Size of text
        SetTextColour(color.r, color.g, color.b, color.a) -- RGBA
        SetTextEntry("STRING")
        AddTextComponentString("Score: " .. num) -- Main Text string
        DrawText( 0.0001, 0.2009) -- x,y of the screen
        
        DrawRect(0.0001 --[[ x ]],0.2100--[[ y ]],0.1--[[ width ]],0.04--[[ height ]],24, 36, 46, 150--[[ rgb ]] )
    end
end)

is this the entire script? ill see if i can make it work for you

If I understand what you want correctly, this will do the trick:

Server

local num = 0

RegisterCommand('add', function(source)
    if source ~= 0 then return end     -- Only allow server console to run this command
    num = num + 1
    TriggerClientEvent('add', -1, num) -- -1 means all players
end, false)

Client

local color = {
    r = 255,
    g = 0,
    b = 75,
    a = 255
}
local num = 0
RegisterNetEvent('add', function(newNum)
    num = newNum
end)

CreateThread(function()
    while true do
        Citizen.Wait(1)
        SetTextFont(0)                                    -- 0-4
        SetTextScale(0.4, 0.4)                            -- Size of text
        SetTextColour(color.r, color.g, color.b, color.a) -- RGBA
        SetTextEntry('STRING')
        AddTextComponentString('Score: ' .. num)          -- Main Text string
        DrawText(0.0001, 0.2009)                          -- x,y of the screen

        DrawRect(0.0001 --[[ x ]], 0.2100 --[[ y ]], 0.1 --[[ width ]], 0.04 --[[ height ]], 24, 36, 46, 150 --[[ rgb ]])
    end
end)

Oh, remember you can only use this in cmd. If you don’t want that, remove the if source ~= 0 block.

you beat me to it lol