Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I detect when a player enters a Region3?

Asked by 4 years ago

So I have a region3 Area defined with 2 parts and I call them in a script.

local AdminRegion1 = Region3.new(workspace.INVAILD_RANK_TP["AdminRegion1-1"],workspace.INVAILD_RANK_TP["AdminRegion1-2"])

The purpose of the script is to teleport users that are not authorized outside of an area which they have entered. I have a table of people that are allowed in, but I don't know how I can detect when the player enters the Region. I didn't see anything on the main developer site for it. Is using Region3 the best option for this, or would it be better to just use a part that detects the player and checks it at the door?

1 answer

Log in to vote
0
Answered by 4 years ago

You'll have to constantly check if there's any parts from any characters within the Region3. You can use FindPartsInRegion3WithWhiteList for this, including only parts from Characters which aren't authorised.

Ad

Answer this question