How to make door only open once you touch enough models

i am making a 3d platformer game and wanted a portal that teleports you to the second world the only thing is that i want it so you can only go to the second world once you have collected all 5 collectibles in the first world

so how would i make it so that the portal only opens once you have touched all five collectibles

also is there a way to play a particle or something like that when you touch the collectible?

Do you mean like after collecting 5 coins or something?

If so, you could add a value into the player, and each time he collects a coin, add +1.

And only when he has 5+, the teleporter would tp him.

if Player.leaderstats.Coins.Value >= RequiredAmount then
hit.Parent.HumanoidRootPart.CFrame = game.Workspace.TP_PART.CFrame
end

I Think You Gotta Script It So That It Gets The Particles

Record the player’s collectibles using a Number Value and check if the player has 5 and open the door for them

create an int value inside the player

collectible.Touched:Connect(function(hit)

if hit.Parent:FindFirstChild("Humanoid") then
   intvalue.Value += 1
   --instantiate a particle
end

)

The script inside the portal

portal.Touched:Connect(function(hit)

if hit.Parent:FindFirstChild("Humanoid") and intValue >= 5 then
    --teleport
end

)

i didnt know that lol

it would probally be easier to just make it so that the portal is set to cancollide off transperancy 1 and contouch off and once you touch all of the models it would change those