leihebi Posted January 23, 2021 Share Posted January 23, 2021 (edited) I don't know what the problem is, but I really can't generate props Here is my code, please see what went wrong //生成电脑 Generate laptop Model shuttermode1 = new Model("ch_prop_laptop_01a"); if (shuttermode1.IsLoaded && shuttermode1.IsInCdImage) { VauitShutter = World.CreateProp(shuttermode1, new Vector3(-1053.576f, 231.1573f, 43.9218f), false, false); VauitShutter.FreezePosition = true; } Edited January 27, 2021 by leihebi Link to comment Share on other sites More sharing options...
LeeC22 Posted January 23, 2021 Share Posted January 23, 2021 2 hours ago, leihebi said: I don't know what the problem is, but I really can't generate props Here is my code, please see what went wrong //生成电脑 Generate laptop Model shuttermode1 = new Model("ch_prop_laptop_01a"); if (shuttermode1.IsLoaded && shuttermode1.IsInCdImage) { VauitShutter = World.CreateProp(shuttermode1, new Vector3(-1053.576f, 231.1573f, 43.9218f), false, false); VauitShutter.FreezePosition = true; } Maybe you need this for that object. https://www.gta5-mods.com/scripts/object-spawn-unlocker Link to comment Share on other sites More sharing options...
mcal Posted January 25, 2021 Share Posted January 25, 2021 (edited) it will never return True for IsLoaded as you have not requested the Model. On most cases, just checking of the model IsInCdImage will be enough, as World.CreateProp() will request the model if i remember right. Though its not as reliable. Model shuttermode1 = new Model("ch_prop_laptop_01a"); shuttermodel1.Request(1000); While(!shuttermodel1.IsLoaded) { Yield(); } if (shuttermode1.IsLoaded && shuttermode1.IsInCdImage) { VauitShutter = World.CreateProp(shuttermode1, new Vector3(-1053.576f, 231.1573f, 43.9218f), false, false); VauitShutter.FreezePosition = true; } Edited January 25, 2021 by mcal typos Link to comment Share on other sites More sharing options...
leihebi Posted January 26, 2021 Author Share Posted January 26, 2021 On 1/26/2021 at 5:10 AM, mcal said: it will never return True for IsLoaded as you have not requested the Model. On most cases, just checking of the model IsInCdImage will be enough, as World.CreateProp() will request the model if i remember right. Though its not as reliable. Model shuttermode1 = new Model("ch_prop_laptop_01a"); shuttermodel1.Request(1000); While(!shuttermodel1.IsLoaded) { Yield(); } if (shuttermode1.IsLoaded && shuttermode1.IsInCdImage) { VauitShutter = World.CreateProp(shuttermode1, new Vector3(-1053.576f, 231.1573f, 43.9218f), false, false); VauitShutter.FreezePosition = true; } Thanks, I'll run the code and see how it works Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now