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.
How to make a TextButton give a particle effect?
2 answers
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
UpperTorso only exists in R15. You should use HumanoidRootPart. HumanoidRootPart and Head are the only two parts that exist in both models.
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
Idk if this will work with a GUI or not.
he said textbutton ^^^^^^
Then put this script in the text button and add a click detector in there
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.

5 comments
Is the text button part of a GUI?
Or a part
yes
it is part of a GUI
Oh