Is there a player who enters the server and automatically gives the item a mod?
Giving an item to player on connection?
/*
* Use OnPlayerSpawned instead of OnPlayerConnected because session storage is null before player hits spawn button
*/
private void OnPlayerSpawned(PlayerSession session) => GiveItem(session, "Guid here", 1);
private void GiveItem(PlayerSession session, string guid, int amount)
{
if (session == null) return;
ItemGeneratorAsset itemGuid = RuntimeHurtDB.Instance.GetObjectByGuid<ItemGeneratorAsset>(guid);
if (itemGuid == null)
{
Puts("Guid is null, please make sure it exists.");
return;
}
ItemObject item = GlobalItemManager.Instance.CreateItem(itemGuid, amount);
GlobalItemManager.Instance.GiveItem(session.Player, item);
} Sorry but I am getting guid is null.. what do I put for the guid? the ID? or the name from itemlist?
I know what a guid is.. so .. unless it looks something like 3232332-232323-232323232-2323232323 where do i find the guid?
I know what a guid is.. so .. unless it looks something like 3232332-232323-232323232-2323232323 where do i find the guid?