Hi everyone, I need to find hitinfo in the method
object OnDispenserGather (ResourceDispenser dispenser, BaseEntity entity)
{
if(!entity.ToPlayer()) return null;
BasePlayer player = entity as BasePlayer;
string name = player.displayName;
if(dispenser.gatherType == ResourceDispenser.GatherType.Ore)
{
player.ChatMessage(Lang("Ore", player.UserIDString));
OreConfig ore = _config.FindItemByName("Осколок руды");
Item items = CreateItem(ore.Name,"seed.pumpkin", ore.Amount);
player.GiveItem(items);
return null;
}
return null;
}
You need to get such a variable -
BaseEntity ent = info? .HitEntity;
BaseEntity ent = info? .HitEntity;