Hi! So, I am basically making a game which includes some checkpoints/stages. I have added a ParticleEmitter to the checkpoint part which works perfectly fine. However, I am stuck on how to make a script that will turn of the ParticleEmitter off when the player touches the part. I have searched all over DevForum but none of them work.
local particle = Path_To_ParticleEmiter
script.Parent.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
particle.Enabled = false -- just disable it
end
end)
local ParticleEmitter = workspace:WaitForChild("Stage 1 Part").ParticleEmitter
script.Parent.Touched:Connect(function(hit) - Opens the .Touched function.
local Player = game.Players:GetPlayerFromCharacter(hit.Parent) -- Retrieves the player when the character touches the part.
if Player then -- If the player has touched the part then.
ParticleEmitter .Enabled = false -- Disable the emitter.
end
end)