Results 1 to 3 of 3

Thread: onObjectGrouped

  1. #1

    onObjectGrouped

    I have scripted protection along time ago on my table with onPickedUp so if they arn't allowed to pick up the item it will cancel and place the object back where it was BUT:

    A massive flaw is people can highlight multiple items of the same instance (EG: Yellows $100 chips and Greens $100 chips) and simply group them.

    There is no way, to my knowledge, that can be detected by scripting.. It is so annoying that trolls join a server, highlight the whole table and group it. Forcing a rewind. We could do with access to this via scripting please.

  2. #2
    Join Date
    May 2016
    Posts
    1,072
    If you group a bunch of items and pick them all up, I am 99% sure onObjectPickUp will trigger for all of them. Alternatively, you could use getAllObjects and do a check on each one for object.held_by_color

    Nothing against your suggestion, but onPickUp is really only for detecting if a single object is being picked up. onObjectPickUp will trigger anytime something is picked up by a player.

  3. #3
    Quote Originally Posted by MrStump View Post
    If you group a bunch of items and pick them all up, I am 99% sure onObjectPickUp will trigger for all of them. Alternatively, you could use getAllObjects and do a check on each one for object.held_by_color

    Nothing against your suggestion, but onPickUp is really only for detecting if a single object is being picked up. onObjectPickUp will trigger anytime something is picked up by a player.
    I think you misunderstood his suggestion. When you box select a bunch of chips and group them with the G button so that they all stack up into a tower, he's saying there's no way to detect that someone has tried to group them together.

    You can try using onObjectSpawn() to detect when a new chip stack has "spawned in". Then check the contents of the stack and see if it's worth separating them again. Otherwise there's no easy way to prevent this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •