I got a little issue with a script for fivem.
I’m trying to make it so when you have a certain model, It will change the relationship between the player and a certain gang.
Here’s what I’ve got so far:
playerPed = GetPlayerPed(-1)
Citizen.CreateThread(function()
while true do
Citizen.Wait(0)
if DoesEntityExist(playerPed) then
-- Ballas
if IsPedModel(playerPed, "g_m_y_ballasout_01") or IsPedModel(playerPed, "g_m_y_ballaorig_01") or IsPedModel(playerPed, "csb_ballasog") or IsPedModel(playerPed, "g_m_y_ballaeast_01") or IsPedModel(playerPed, "a_m_y_soucent_02") or IsPedModel(playerPed, "g_m_y_strpunk_01") or IsPedModel(playerPed, "ig_ballasog") or IsPedModel(playerPed, "g_f_y_ballas_01") or IsPedModel(playerPed, "csb_grove_str_dlr") then
SetRelationshipBetweenGroups(1, GetHashKey("AMBIENT_GANG_BALLAS"), GetHashKey("PLAYER"))
SetRelationshipBetweenGroups(1, GetHashKey("PLAYER"), GetHashKey("AMBIENT_GANG_BALLAS"))
end
-- Families
if IsPedModel(playerPed, "g_f_y_families_01") or IsPedModel(playerPed, "g_m_y_famfor_01") or IsPedModel(playerPed, "g_m_y_famdnf_01") or IsPedModel(playerPed, "g_m_y_famca_01") or IsPedModel(playerPed, "mp_m_famdd_01") or IsPedModel(playerPed, "csb_ramp_gang") or IsPedModel(playerPed, "ig_ramp_gang") then
SetRelationshipBetweenGroups(1, GetHashKey("AMBIENT_GANG_FAMILY"), GetHashKey("PLAYER"))
SetRelationshipBetweenGroups(1, GetHashKey("PLAYER"), GetHashKey("AMBIENT_GANG_FAMILY"))
end
-- Shared
if IsPedModel(playerPed, "a_m_m_og_boss_01") or IsPedModel(playerPed, "a_m_y_soucent_02") or IsPedModel(playerPed, "csb_denise_friend") or IsPedModel(playerPed, "csb_g") or IsPedModel(playerPed, "g_m_y_strpunk_02") or IsPedModel(playerPed, "s_m_y_dealer_01") or IsPedModel(playerPed, "a_m_m_soucent_01") or IsPedModel(playerPed, "ig_claypain") or IsPedModel(playerPed, "ig_tonya") then
SetRelationshipBetweenGroups(1, GetHashKey("AMBIENT_GANG_FAMILY"), GetHashKey("PLAYER"))
SetRelationshipBetweenGroups(1, GetHashKey("PLAYER"), GetHashKey("AMBIENT_GANG_FAMILY"))
SetRelationshipBetweenGroups(1, GetHashKey("AMBIENT_GANG_BALLAS"), GetHashKey("PLAYER"))
SetRelationshipBetweenGroups(1, GetHashKey("PLAYER"), GetHashKey("AMBIENT_GANG_BALLAS"))
end
end
end
end)
It works, but when I change my model, it doesn’t change the relationship.
If anyone knows what I need to do, please let me know