How do I set a global variable in-game? (Tax System)

Hey guys, I’m so glad to participate t forum :slight_smile:

I’m making a system that:
Every 5 in 5 minutes discount % in wallet people and add it on server… like “Wallet Tax” in DarkRP…

How do I set a global variable, to all people see this on HUD?

I will give a example…

self:SetDarkRPVar(“taxcity”, amount)

How do I show this variable on HUD to all players online?

(Sorry; I’m still learning LUA)
Thanks!

You’ll need a function hooked to HUDPaint on clients side.
You’ll need to set a variable serverside and send it to the client.

To do so
You’ll need to do this on server side:
[lua]util.AddNetworkString(“NET_taxMsg”)

function SetTaxes()
local TaxPercentage = 0.75

net.Start(“NET_taxMsg”)
net.WriteFloat(TaxPercentage)
net.Broadcast()
end[/lua]

And on clientside:

[lua]function ReceiveTax()
local TaxPercentage = net.ReadFloat()
end
net.Receive(“NET_taxMsg”, ReceiveTax)[/lua]

Solved!