How to set Gravity?

I have taken this from natives, but can not seem to implement it correctly. I am hoping someone can show me a proper implementation for use.
// SetGravityLevel
void SET_GRAVITY_LEVEL(int level);
level can be from 0 to 3
0: 9.8
1: 2.4
2: 0.1 - very low
3: 0.0

Currently i have tried in client side the following.

Citizen.CreateThread(function()
    while true do
		Citizen.Wait(1)
                SetGravityLevel(2)
	end
end)

-- also tried float.
Citizen.CreateThread(function()
    while true do
		Citizen.Wait(1)
                SetGravityLevel(0.2)
	end
end)

Try this :

RegisterCommand(“gravity”, function(source, args, rawCommand)
SetGravityLevel(PlayerPedId(), 0.2)
end)

with my PlayerPedId you set your own player as Entity and set him the gravity level
the 0,2 is your numer what you want to set