so i am making this obby and i have created this checkpoints but i want the checkpoints to have like a effect when you're tuching it ( like a particle emmiter (confetti) ) but i only want it to happend once per player. Can Somebody help me with both?
-L30N_C
First, I set a variable called touch to see if the player has already touched the part
local touch = false
Next i used .Touched to see if the player touched the Part.
script.Parent.Touched:Connect(function()
Then after that, i saw if touch equaled false
if touch == false then
I created a new instance "ParticleEmitter" and put a wait(3) then destroyed it and also put touch to be equal to true
local conf = Instance.new("ParticleEmitter") conf.Parent = script.Parent touch = true wait(3) script.Parent:FindFirstChild("ParticleEmitter"):Destroy()
So, it should end up like this
local touch = false script.Parent.Touched:Connect(function() if touch == false then local conf = Instance.new("ParticleEmitter") conf.Parent = script.Parent touch = true wait(3) script.Parent:FindFirstChild("ParticleEmitter"):Destroy() end end)
Closed as Not Constructive by JesseSong
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?