var model = new CitizenFX.Core.Model(PedHash.Cop01SFY);
model.Request();
while (!model.IsLoaded)
Function.Call(Hash.WAIT, 0); // this is what's crashing it
Function.Call(Hash.SET_PLAYER_MODEL, model.Hash);
Function.Call(Hash.SET_PED_DEFAULT_COMPONENT_VARIATION, LocalPlayer);
model.MarkAsNoLongerNeeded();
How can I call WAIT while waiting for the model to load without crashing the game?