You could use touch events that change a value in the player called “area” or something like that. Then you can use a script that gets the players area then does something. Since you can use area.value.changed.
You can use BasePart:GetTouchingParts() for this
Example:
function IsInside(area, character)
for i, v in pairs(area:GetTouchingParts()) do
if (v:IsDescendantOf(character)) then
return true
end
end
return false
end
Do note that if CanCollide is set to false, a temporary Touched event must be connected for this to work
I heavily encourage you to use Region3 because Touched events are pretty unreliable for cases like this. Especially if you’re going to be trying to seek when the player is no longer in the region.
local region = Region3.new(Vector3.New(0,0,0) , Vector3.New(0,0,0) ) – change zero’s for the region3’s size
game.Workspace.Part.Size = region.Size
local part = Instance.new(“Part”)
part.Size = region.Size
while true do
wait()
local partsInRegion = game.Workspace:FindPartInRegion3(region, part , max amount of parts inside region3)
for i,v in pairs(partsInRegion) do
print(v.Name)
end
end
end