#Player.Get error with IGameComponent
1 messages · Page 1 of 1 (latest)
Have you removed reference to PluginAPI?
wait what
are you sure ur using Labapi Player
Yep
Yea, old LabAPI version was working fine.
should not be the latest version of LabAPI (0.5.0.0)
Player.Get(ReferenceHub) was added in 0.0.5.0
or using problem
show the Dependencies->Asssembly
You mean dependencies list?
are you sure your publizied one is 14.0.3 / labapi beta?
Also whole file for reference (it's not only isssue with this file but still)
using HarmonyLib;
using LabApi.Features.Wrappers;
using ServerCore.Subclass.Models;
using PlayerStatsSystem;
namespace ServerCore.Subclass.Patches
{
[HarmonyPatch(typeof(HealthStat))]
internal static class HealthStatPatch
{
[HarmonyPatch(nameof(HealthStat.MaxValue), MethodType.Getter)]
private static bool Prefix(ref float __result, HealthStat __instance)
{
if (__instance?.Hub == null || Player.Get(__instance.Hub) == null || !SubclassAPI.AsignedRoles.TryGetValue(Player.Get(__instance.Hub).UserId, out CustomClass playerRole) || playerRole.MaxHp == -1)
return true;
__result = playerRole.MaxHp;
return false;
}
}
}```
Yea, downloaded and publicized everything today
I will validate it again tho, just to be sure
no error for me
And now it works even tho I downloaded everything again 2 times 
So basically my skill issue
thanks
I still don't know how no other thing was wrong tho
