Fix for Touched and TouchedEnded repeatably firing?

I’m trying to make these pads where when a player walks on them it adds them to a players table and when the walk off it, it removes them. This works but I have this annoying issue where it keeps firing even though my character isn’t moving. I’ve tried region 3 but you have to use loops etc and I’d rather not because I’m worried it will use a lot of server memory but if I have to I will. Anyways how do I fix this?

Note: If a player is already on a pad another player cannot come and take their position while they are still standing on it.

Thanks, Alpha

local Player1Pad = script.Parent:WaitForChild("Player1") --Pad you walk on
local Player2Pad = script.Parent:WaitForChild("Player2")

local Players = {}

Player1Pad.Touched:Connect(function(HitInstance)
	print(HitInstance)
	if HitInstance.Parent:FindFirstChild("Humanoid") then
		if Players[1] == nil then
			table.insert(Players, game.Players[HitInstance.Parent.Name])
			Player1Pad.Material = Enum.Material.Neon
			local Goal = {} Goal.Color = Color3.fromRGB(0, 100, 165)
			local Tween = game:GetService("TweenService"):Create(Player1Pad, TweenInfo.new(0.5), Goal)
			Tween:Play()
			wait(1)
		else
			for i, Player in pairs(Players) do
				if Player.Name ~= HitInstance.Parent.Name then
					table.insert(Players, game.Players[HitInstance.Parent.Name])
					Player1Pad.Material = Enum.Material.Neon
					local Goal = {} Goal.Color = Color3.fromRGB(0, 100, 165)
					local Tween = game:GetService("TweenService"):Create(Player1Pad, TweenInfo.new(0.5), Goal)
					Tween:Play()
					wait(1)
				end
			end
		end
	end
end)
Player1Pad.TouchEnded:Connect(function(HitInstance)
	if HitInstance.Parent:FindFirstChild("Humanoid") then
		for i, Player in pairs(Players) do
			if Player.Name == HitInstance.Parent.Name then
				table.remove(Players, i)
				Player1Pad.Material = Enum.Material.SmoothPlastic
				local Goal = {} Goal.Color = Color3.fromRGB(163, 162, 165)
				local Tween = game:GetService("TweenService"):Create(Player1Pad, TweenInfo.new(0.5), Goal)
				Tween:Play()
				wait(3)
			end
		end
	end
end)

So add the players parts to a table is what your saying?
Also I’m using R6.

Touching events are unpredictable, especially TouchEnded. Once you touch it, it goes into an extreme rapid firing of the event. Alternate the method by starting with Touched event and then use raycasting or Region3 to check for players in the area. At the time when the results are precise, do a last check and then add or remove players to or from the table.

Or you could add the parts touched to another table which is used for checking for players. Which could work as well.

I was thinking of using touchended then using region3 to check if they are still inside. Do you think that would work?

Actually never mind that. I remember perfectly that this function exists:

Problem is that you have to connect the part to Touched event first.

All you need to do is to run a loop through the array and then check for players.