Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a TextButton give a particle effect?

Asked by 7 years ago
Edited 7 years ago

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.

0
Is the text button part of a GUI? rilgundam 65 — 7y
0
Or a part rilgundam 65 — 7y
0
yes jatytech 45 — 7y
0
it is part of a GUI jatytech 45 — 7y
0
Oh rilgundam 65 — 7y

2 answers

Log in to vote
1
Answered by 7 years ago

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.

0
UpperTorso only exists in R15. You should use HumanoidRootPart. HumanoidRootPart and Head are the only two parts that exist in both models. Thundermaker300 554 — 7y
0
Very true. ^^^ But its really a simple change though, just change a word. Wutsinhower 23 — 7y
Ad
Log in to vote
0
Answered by 7 years ago

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!

0
Idk if this will work with a GUI or not. rilgundam 65 — 7y
0
he said textbutton ^^^^^^ bossay6 62 — 7y
0
Then put this script in the text button and add a click detector in there rilgundam 65 — 7y
0
lmao that's not how click detectors work - they gotta be parented to a BasePart. Thundermaker300 554 — 7y

Answer this question