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

How to make a TextButton give a particle effect?

How to make a TextButton which will give you a particle effect when you click it. I know how to make it give you a particle effect when you touch a part but I don't need that.

5 comments

0

Is the text button part of a GUI?

0

Or a part

0

yes

0

it is part of a GUI

0

Oh

2 answers

✓ Accepted answer

You would insert a Local Script into your TextButton, and in this script you would put:

button = script.Parent
plr = game.Players.LocalPlayer

button.MouseButton1Click:connect(function()
	local PE = game.Workspace.ParticleEmitterPart.ParticleEmitter:clone()
	PE.Parent = plr.Character.UpperTorso
end)

"button" Would be calling your TextButton, and plr would be calling the Player. This function says whenever you click your TextButton, it clones the ParticleEmitter in your workspace or in this script, the particle emitter in a part. Then you would make the particle emitters parent any body part. Right now I'm cloning it into the UpperTorso of the character.

2 comments

0

UpperTorso only exists in R15. You should use HumanoidRootPart. HumanoidRootPart and Head are the only two parts that exist in both models.

0

Very true. ^^^ But its really a simple change though, just change a word.

Try this

local clickdetector = script.Parent:WaitForChild("ClickDetector")

clickdetector.MouseClick:Connect(function()
 --insert what you want to happen when you click it.
end)

And don't forget to add a click detector to your part. Accept my answer if this works!

4 comments

0

Idk if this will work with a GUI or not.

0

he said textbutton ^^^^^^

0

Then put this script in the text button and add a click detector in there

0

lmao that's not how click detectors work - they gotta be parented to a BasePart.

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