PDA

View Full Version : onObjectGrouped



Crazy
02-04-2017, 07:28 PM
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.

MrStump
02-04-2017, 09:52 PM
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.

Mark
02-05-2017, 03:56 PM
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.