Tabletop Simulator

Tabletop Simulator

Zone Protection Tool
27 Comments
Toaster Jan 10, 2022 @ 3:35pm 
Shame that people can still use pieces to nudge other pieces out of protected zones. This still is a great utility so my friends can show off their towers of poker chips
victorhurtado Mar 14, 2021 @ 4:17pm 
Would be cool of the tool's protection extended to buttons and text fields, specially the ones from your character sheet template.
GeneralHannibal Mar 25, 2020 @ 8:58pm 
I'm trying to use this mod on my DnD table but it doesn't seem to be working. I'm pretty sure I followed the instructions correctly:
-spawn in the ON/OFF button
-spawn the protection zone and create a script zone over it
-save then load the table
-copy the GUID of the script zone and edit the code of the ON/OFF button

Am I missing something ? I don't know what I'm missing or if I forgot a step. Any help would be appreciated!
Brain5000 May 5, 2019 @ 11:44pm 
how do i put scripted zone?
ChizBallz Apr 4, 2018 @ 6:42pm 
@lionbryce, i try adding your line of code, and it's giving me errors saying <onObjectPickedUp>: chunk_1:(89.25-33): cannot access field of userdata<LuaGlobalPlayer>. This error pops up everytime someone picks up an object in a restricted zone.
ChizBallz Apr 4, 2018 @ 4:31pm 
Does anyone know how I would make it broadcast the message in the same color of the player that's picking up the object illegally? Is it also possible make it so that it can prevent people from nudging, rotating and flipping objects that are inside the protected zone as well?
So many eggs Mar 8, 2018 @ 11:51am 
BTW, for those with people who are "extra annoying" and try relentlessly to drag a piece from someone's area (which is possible) open up the lua editor and put

Player[c].changeColor("Grey")
--after the line that says
broadcastToColor("You are not permitted to pick up objects in this zone.", color, {0.9,0.2,0.2})
ChizBallz Sep 14, 2017 @ 5:22pm 
Have any of you guys figure out how to broadcast to all from which zone the player is attempting to move objects from? Like Duranu says, it would be useful for everyone to know who the trouble maker is at the table for moderation purposes. Perhaps a color coded message (so it's easier to see at a glance what zones are being tampered with) saying, Offender's name attempted to pick up an object from Victim's name ZoneI also noticed that you're still able to flip a persons card, is there anyway to prevent that as well?
Duranu Lithdel Aug 2, 2017 @ 8:55pm 
Dont want that to sound unthankful, It is appreciated, while not exactly what I was looking for it will atleast tell who is mucking about and doing things they shouldnt be, thank you
Duranu Lithdel Aug 2, 2017 @ 8:32pm 
That works on telling that I tried to pick up an object illegally, appreciated. And no it does not pull the zone info of where (color) they tried to take it from
MrStump  [author] Aug 2, 2017 @ 8:28pm 
broadcastToAll(Player[color].steam_name .. " attempted to pick up an object illegally.", {0.9, 0.2, 0.2})

I don't have it open to check ot see if it passes the zone information for the color zone they were trying to take it from.
Duranu Lithdel Aug 2, 2017 @ 8:24pm 
I have that functional and plan on using that still as a no no to the offender but was also looking for a way to broadcasttoall "(offening color) tired to take an item from (Victim Color)'s zone" or at least a broadcast to the host on who tried to do what to who, in a way to know whom is trying to mess with who to help better moderate when griefers roll in, Thanks though
MrStump  [author] Aug 2, 2017 @ 8:19pm 
That may have been my script too haha maybe not though. I wrote one for a few BJ tables with announcements.

This one sends a message to just the player. It looks like this:
broadcastToColor("You are not permitted to pick up objects in this zone.", color, {0.9,0.2,0.2})
You could change that to broadcast a message to everyone if you like.
Duranu Lithdel Aug 2, 2017 @ 8:11pm 
Messing around with the script, saw on another server (think it was someones custom black jack) When the wrong person picked up someones item it would broadcast "(Color) tried to take an item from (colors) zone" or something to that effect, thats obviously a broadcastall instead of color so everyone sees it, but was just wondering what the value would be to add to the script for the messge to pull the color of the offender and the color of the victim for the broadcast, gonna keep tinkering with it to try to figure it out on my own to hopefully figure it out, but assistance would be cool
MrStump  [author] Jul 30, 2017 @ 7:35am 
I have no way of accessing search. And the objects "spawn" out of the bag. I could do a check for onObjectLeaveContainer to find it, but putting an object back into a bag when the search window is open can delete the item. So I could detect it being stolen but not recover it.

As for going fast enough, it has to do with the load time for the item when it comes into existance. I could use the same solution I just mentioned, but then if someone was doing "search crime" it would delete stuff, which I prefer not to do. I'd rather leave the small loophole that forces someone to obviously and violently cheat (like you can see the msearching your bag). I think of this as more "casual cheating protection"
So many eggs Jul 30, 2017 @ 12:59am 
Also, if you try hard enough, and move fast enough, you can still pull objects off the top, even if they're in the script
So many eggs Jul 30, 2017 @ 12:50am 
Yeah, a taller scripting zone fixed it, however, I would recommend trying to add bag detection to fix a simple loophole if you have "search" enabled (so far the farthest I can get still has a loophole in it)
MrStump  [author] Jul 29, 2017 @ 2:39pm 
The poker chip thing should work too. It is possible that your scripting zone was too short, so the "stack" of chips was taller than the zone so when they picked up the chip, it wasn't in the zone.

Try making a taller scripting zone. Does that solve it? Also, not sure about the error. Myabe onObjectPickedUp is indeed getting called by the script, in which case, WEIRD. I'll make a note to look at it. If that is the case, then I should be able to put in an exception to prevent that error.
So many eggs Jul 29, 2017 @ 12:54pm 
An error is called whenever you use the "smart bag" to move objects, it doesn't break it though, figured you may be interested (I'm guessing it's because a player isn't the one picking it up)
So many eggs Jul 29, 2017 @ 12:51pm 
If you grab the top object from a stack, like poker chips, and only the top, you can grab it freely
OtakUkulele Jun 1, 2017 @ 11:07pm 
Works wonderfully! Did some testing, and noticed some things that can "override" the protection. Luckily, you can fix it no problem without tampering with the script

1. U can flick it, so just disable flicking ;p

2. If you raise the object (By pressing R) over the scripted zone, u can grab it, so u would just need to raise the scripted zone itself :)

Its a great mod! And good job man!
Gaming_Bigfoot May 24, 2017 @ 10:24am 
Having diffuculty getting it to work. Tutorial vid would be appreciated.
Rave Jesus May 22, 2017 @ 7:29am 
Was just talking to a friend about wanting something like this, and here it is. Thanks.
PetersProblem May 22, 2017 @ 4:10am 
I did. I'll keep tinkering with it till I get a result.
MrStump  [author] May 21, 2017 @ 7:33pm 
Sorry no. Did you look in the object's script? I tried to leave clear instructions as well as an example to follow there.
PetersProblem May 21, 2017 @ 9:14am 
I was trying to figure this out but had no success. Can you post a vid explaining it?
Unreal Ed May 17, 2017 @ 6:25pm 
Love that you actually did it !