I want to get all ToolCupboards of the server to identify on which Cupboards the player is authorized
With some research I got this but the Constant ToolCupboard does not exist. How i could achieve that?
Code:var cups = BaseEntity.serverEntities.Where(x => x is ToolCupboard).ToList();
Getting all ToolCupboards (of a specific player)
Discussion in 'Rust Development' started by Fuzzle, Nov 29, 2017.
-
Code:
(x => x is ToolCupboard)
Code:(x => x is BuildingPrivlidge)
-
That method screams lag to me...
-
maybe something like this?
Code:List<BuildingPrivlidge> ownedCupboards = UnityEngine.Object.FindObjectsOfType<BuildingPrivlidge>().Where(instance => instance.GetComponent<BaseEntity>()?.OwnerID == player.userID).ToList();
-
I would just do a spherecast within a distance to be honest.