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)