#How can i do this?
1 messages · Page 1 of 1 (latest)
Just give it to the player after the delay?
player.Give
you can do this
Timing.CallDelayed(0.1f, () =>
{
player.CurrentItem = player.Items.FirstOrDefault(x => x.Type == item);
});
no
i need create item
dont give them
thats for example
why do you want to "create an item"
Yea
you can create pickups
but why do you create an item
to store for later?
then don't create it at all
^
Like I have a container of items with specified serials
These items already created
And in the moment when player write command that item gives to them
This is my backpack system on exiled
InventoryExtensions::ServerAddItem
You can specify an item serial
I mean depending on what item it is, you can just store ItemType and Serial and be able to just remove and serveradditem without actually "storing" them persay
Alternatively you can literally throw the items into the void and only retrieve them when you need them
Or alternatively you might be able destroy the model but keep the other stuff? That way you can just force the player to pick up the item
Might not work though
I mean to say this because you can also specify a pickup in ServerAddItem
You need to destroy the old pickup afterwards though, otherwise things get messy
(This effectively forces a player to pick up an existing item)
The only reason I bring up the alternatives is because other data about the item is lost if you only save ItemType and Serial
(e.g. Firearm attachments)
Although you could just save those as well and call it a day instead of worrying how to handle the residual item pickups
One comment I have is that your original question asks how you can create an item, and then give it after a delay
If you're creating an item, but not doing anything with it until you give it to someone, then there's no point in creating the item until you actually give it to someone