Turn off CanTouch on Part for 1 Player

I have been trying to turn off the CanTouch Event for players who pass a certain part so they can’t go back and keep getting the reward.

I tried doing this in a local script, but it disabled CanTouch for all players

if Human then
	script.Parent.Portal.CanTouch = false
end

Anyway to do this? This script is inside a part BTW

Wrong category. This should be in #help-and-feedback.

Sorry I changed it to #help-and-feedback

local blacklisted = {}

part.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid then
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		if not table.find(blacklisted, player.UserId) then
			table.insert(blacklisted, player.UserId)
			-- reward the player
		else
			return
		end
	end
end)

EDIT: oh shoot i didnt read that you meant a certain point

Let me try this, I think it will solve my problem. I can give the reward before the blacklist and then the player won’t be able to keep on going back and forth. Thanks! I will let you know

Ok, try to find a way to create a table, and then put users in the blacklisted table once they reach that part.
EDIT: i updated the script

Make it so they can only claim the reward once, for example have a “HasClaimed” value in the player. Make a localscript where you turn on/off collisions depending on the HasClaimed value.

Yes also that, but its probably easier to do a table.

Depending on your game, do make sure that you remove the player from the table when they leave the game. Otherwise, you might get memory issues.