so i have a server command that triggers a client event with the command argument like this
TriggerEvent('es:addGroupCommand', 'density', 'admin', function(source, args, user)
TriggerClientEvent('scrp-scripts:fixtraffic', -1, args[1])
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
end, {help = 'Fordons densitet, 0.0 = inga, 1.0 = normalt'})
then i dont really know how to make the client do as i want:
local density = 1.0
RegisterNetEvent('scrp-scripts:fixtraffic')
AddEventHandler('scrp-scripts:fixtraffic', function(arg)
density = arg
end)
Citizen.CreateThread(function()
while true do
SetVehicleDensityMultiplierThisFrame(density)
Citizen.Wait(2)
end
end)
i want the density to be the arg number when the event gets triggerd which in that turn changes the SetVehicleDensityMultiplierThisFrame value