Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

steam-76561198088513750

How does the flashlight of the reborn player come with batteries

Recommended Posts

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
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

            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

×