Which hook for picking up plants?Solved
Which hook to use when you are picking up plants?
OnCropGather
5ba0b9633e817.png?uid=5ba0b9716c220 2CHEVSKII
OnCropGather

Oh i must be blind one more question how can you make it that it will only use certain plant? Im kinda new to this stuff.

CrazyBeast

Oh i must be blind one more question how can you make it that it will only use certain plant? Im kinda new to this stuff.

Check by shortname

5ba216a6d7f65.png Orange

Check by shortname

do you mean like this

 object OnCropGather(PlantEntity plant, Item item, BasePlayer player)
        {
            if (plant.info.shortname != "corn-collectable") return;

There really aint that much information about checking shortnames etc. Could you hook me up with some sources or example?

CrazyBeast

do you mean like this

 object OnCropGather(PlantEntity plant, Item item, BasePlayer player)
        {
            if (plant.info.shortname != "corn-collectable") return;

There really aint that much information about checking shortnames etc. Could you hook me up with some sources or example?

I can recommend you to start with C# basics and installing IDE + Decompiler. Right here you are trying to get shortname from BaseEntity, that doesnt have that parameter

5ba216a6d7f65.png Orange

I can recommend you to start with C# basics and installing IDE + Decompiler. Right here you are trying to get shortname from BaseEntity, that doesnt have that parameter

Oh yea true i gotta do some more research thanks :)

Locked automatically