RedxYeti Posted November 16, 2021 Share Posted November 16, 2021 im using this code int n = Alias_FormList.GetSize() - 1 n = utility.RandomInt(0, n) PlayerREF.EquipItem(Alias_FormList.GetAt(n))(left over from skyrim ck) But when the weapon is equipped from the formlist, theres a good chance its invisible and the magazine is always empty. is there a better way to do this with FO4 CK? Link to comment Share on other sites More sharing options...
LarannKiar Posted November 16, 2021 Share Posted November 16, 2021 Is this a mod added or vanilla weapon? Try this code: int n = Alias_FormList.GetSize() - 1 n = utility.RandomInt(0, n) Weapon myWeapon = (Alias_FormList.GetAt(n) as Weapon) PlayerRef.AddItem(myWeapon) PlayerRef.EquipItem(myWeapon) Link to comment Share on other sites More sharing options...
RedxYeti Posted November 17, 2021 Author Share Posted November 17, 2021 Try this code: int n = Alias_FormList.GetSize() - 1 n = utility.RandomInt(0, n) Weapon myWeapon = (Alias_FormList.GetAt(n) as Weapon) PlayerRef.AddItem(myWeapon) PlayerRef.EquipItem(myWeapon) that worked, thank you so much :thumbsup: Link to comment Share on other sites More sharing options...
Recommended Posts