steam-76561198088513750 0 Posted October 5, 2019 This is my spawn code.(init.c) player.GetInventory().CreateInInventory("FlashLight"); How to attach batteries to flashlight↑ I tried to write like this, but it didn't work↓ Please help me. I am a rookie. :) player.GetInventory().CreateInInventory("FlashLight"); player.GetInventory().CreateAttachment("Batery9v"); Share this post Link to post Share on other sites
steam-76561198088513750 0 Posted October 5, 2019 (edited) I solved the problem myself.everybody don't have to reply. Edited October 5, 2019 by steam-76561198088513750 Share this post Link to post Share on other sites
Sid Debian 138 Posted November 2, 2019 On 10/5/2019 at 10:20 PM, steam-76561198088513750 said: I solved the problem myself.everybody don't have to reply. You're nice man, but better write your way to solve that. ItemBase flashlight = player.GetInventory().CreateInInventory("Flashlight"); //Create flashlite flashlight.GetInventory().CreateAttachment("Battery9V"); // IN flashlite create battery ItemBase.Cast(flashlight); // Save upcating player.SetQuickBarEntityShortcut(flashlight, 4, true); // Set item to a slot of tray Share this post Link to post Share on other sites
steam-76561198088513750 0 Posted November 5, 2019 EntityAI itemTop = player.GetInventory().CreateInInventory("FlashLight"); itemTop.GetInventory().CreateAttachment("Battery9V"); On 2019/11/2 at PM4点25分, Sid Debian said: 你是一个好人,但最好写出解决办法。 Share this post Link to post Share on other sites