Region3 is driving me insane

I’ll make some quick changes in hopes it fixes it

Ok, it seems to work but

local function ScanPlayerMovement()
	for plot, region3 in pairs(Region3Table) do
		local currentHRP = workspace:FindPartsInRegion3WithWhiteList(region3, GetPlayerHRPs())
		local currentPlayers = FindPlayersFromHRP(currentHRP)

		local newPlayers = SetSubtract(currentPlayers, PlotPlayer[plot])

		for _, player in pairs(newPlayers) do
			game.ReplicatedStorage.RemoteEvents.Remote11:FireClient(player, TheRegionPart)
		end

		PlotPlayer[plot] = currentPlayers
	end
end

Where it says TheRegionPart I need to send the part to the client so I can get the name

getting the name on the client is not going to help anyways also it is not safe since exploiters can return the wrong name

I’m aware, there are some exploits you simply cannot do anything about without making it annoying for the average player

And I need the name to decide what text pops up. So big woop if they change the name of a text gui?
Edit: Which they can already do

definitely a big woop and someone might write an exploit for it soon

Best way is probably just referencing player.Name on the server script

You’re clearly not understanding, so let me explain in more simple terms.

I’m having the server tell the client the name of the place they have entered. The name displays on a text GUI. It doesn’t matter if this is exploited as it doesn’t serve any purpose but to inform the player.

then what is the error? then, I see nothing wrong about the code

I need to give the part’s name to the client in this line

game.ReplicatedStorage.RemoteEvents.Remote11:FireClient(player, TheRegionPart)

in this function

local function ScanPlayerMovement()
	for plot, region3 in pairs(Region3Table) do
		local currentHRP = workspace:FindPartsInRegion3WithWhiteList(region3, GetPlayerHRPs())
		local currentPlayers = FindPlayersFromHRP(currentHRP)

		local newPlayers = SetSubtract(currentPlayers, PlotPlayer[plot])

		for _, player in pairs(newPlayers) do
			game.ReplicatedStorage.RemoteEvents.Remote11:FireClient(player, TheRegionPart)
		end

		PlotPlayer[plot] = currentPlayers
	end
end

Well, I didn’t mean for you to copy the code directly because there are some extra computations being done which may or may not be important to your game.

Adjust the Vector3’s in InitializeTables() to also add half the height of the region to the y component.

And when you’re firing to the client, pass plot. Based on what you’re populating in your table, plot is the corresponding part to each Region3.

Gotcha :sweat_smile: I assumed the code wasn’t meant to be copied directly and tried to change it but was unsure about how to- didn’t help that I was extremely tired last night, I’ll tweak it and hope it works, thanks again for your continued help

Ok, so, the script kind of works now

local function ScanPlayerMovement()
	for plot, region3 in pairs(Region3Table) do
		local currentHRP = workspace:FindPartsInRegion3WithWhiteList(region3, GetPlayerHRPs())
		local currentPlayers = FindPlayersFromHRP(currentHRP)

		local newPlayers = SetSubtract(currentPlayers, PlotPlayer[plot])
		print(plot) -- Debug to see if the script was actually running to this point (it was)
		for _, player in pairs(newPlayers) do -- This loop never runs (if it does nothing inside ever runs)
			print("FIRED") -- Debug to see if it found players and fired the client
			game.ReplicatedStorage.RemoteEvents.Remote11:FireClient(player, plot)
                        -- There was also a debug on the client to make sure, for some reason, the local script received the event
		end

		PlotPlayer[plot] = currentPlayers
	end
end

Would you mind helping me again and figuring this out? :sweat_smile: Detecting the player of course

I give up, I’ll just try BasePart:GetTouchingParts() for this.