Hey, i’m trying to do a script that scan if a player has a weapon.
But this native doesn’t work. How could I do ?

Thank you !

Pretty simple.

	local w = GetHashKey("WEAPON_PISTOL") 
	local hasweapon = HasPedGotWeapon(GetPlayerPed(-1),w,false)

Possible WEAPON_* entries are here https://www.gtamodding.com/wiki/Weapon_Types

1 Like

K’, it returns a bool ?

Yep. You ask the question “Has Ped Got Weapon”, and so the answer you get is true or false

Pretty logic… Thank you !