Skip to content

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

@xCynDev

Description

@xCynDev

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;
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaThis is an idea to doimportedImported to internal git

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions