LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[IDEA] Add a predicate for admin toys that determines which clients should receive it.

Open xCynDev opened this issue 1 year ago • 3 comments

Goal Description

It would be nice if we could set a predicate on admin toys to determine which clients should receive it.

It should be able to pass it into AdminToy.Create<T>(), so that it gets checked before even spawning the toy.

This would potentially require SL to write a custom interest management component if it doesn't have one (which seems to be the case). Otherwise maybe manually send spawn messages to select clients instead.

Notes

  • A simple Func<Player, bool> would work pretty well in my opinion.
  • Should default to null.

Example

var toy = AdminToy.Create<SpeakerToy>(position, rotation, scale, parent, (ply) =>
{
    return ply.Team == Team.SCPs;
});

xCynDev avatar Jun 07 '25 00:06 xCynDev

I think it would be nice to add predicate to all methods like Door.Get/Player.Get and etc too. Maybe there are more this kind of methods.

Could you add this to your IDEA pls :)

TheLongQuite avatar Jun 07 '25 07:06 TheLongQuite

Thank you for your suggestion! We've logged this issue in our internal git system for further review and tracking. Please note that this doesn't guarantee acceptance or implementation at this stage. If we need any additional information or clarification, we'll be sure to reach out to you.

Jesus-QC avatar Oct 14 '25 09:10 Jesus-QC

We've reopened this suggestion to prevent confusion and duplicate posts. As stated before, the issue has been added to our internal tracker, but that does not guarantee acceptance nor implementation.

Axwabo avatar Apr 27 '26 17:04 Axwabo