Touching a part gives me more than 1 point instead of just 1 i need help

I need help with this script because I want it to only give 1 point and not 5 because it touches other body parts of the players character.

local triggerPart = script.Parent
local targetPart = game.Workspace:FindFirstChild(“TpTo”)

triggerPart.Touched:Connect(function(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)

if player and targetPart then
	-- Teleport the player
	character:SetPrimaryPartCFrame(targetPart.CFrame)

	-- Add 1 score to the leaderstats
	local leaderstats = player:FindFirstChild("leaderstats")
	if leaderstats then
		local score = leaderstats:FindFirstChild("Score")
		if score then
			score.Value = score.Value + 1
		end
	end
end

end)

add a debounce or instead of connect use :Once

2 Likes

It worked thank you so much i appreciate it if u want to check out the game its Cart ride into ryan gosling Cart Ride into Ryan Gosling (New Carts😱) - Roblox