Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making particles appear when touching a spawnpoint doesn't work, anyone able to help ?

I made a script to make a particle's clone to weld to the player and move it a bit, then I made another script to make it appear and disappear when I touch a spawnpoint but it doesn't work. Here's the script :

local Checkpoint = script.Parent local Player = game.Workspace.LocalPlayer local Part = Player:WaitForChild("LevelUpParticles") local Particles = Part:WaitForChild("ParticleEmmiter") Checkpoint.Touched:Connect(function() for i = 0,5 do Particles.Rate = Particles.Rate +1 wait(.1) end end)
wait(1) for i = 0,5 do Particles.Rate = Particles.Rate -1 wait(.1) end

It's a local script that I placed directly in the spawnpoint ( I also don't get any errors in the output)

1 comment

0

Use a debounce.

1 answer

Here I added a debounce and organized your script a bit.

local Checkpoint = script.Parent
local Player = game.Workspace.LocalPlayer
local Part = Player:WaitForChild("LevelUpParticles")
local Particles = Part:WaitForChild("ParticleEmmiter")
local Debounce = false

Checkpoint.Touched:Connect(function()
	if Debounce == false then
		Debounce = true
		for i = 0,5 do
			Particles.Rate = Particles.Rate +1
			wait(.1)
		end
		wait(1)
		for i = 0,5 do
			Particles.Rate = Particles.Rate -1
			wait(.1)
		end
		Debounce = false
	end
end)

Use the "Tab" key to organize your code. I had a bit of a hard time understanding it.

This discussion is preserved as it was. New answers, comments, and votes are closed.