I'm currently in the process of trying to make a gui that allows players to toggle transformations from Dragon Ball Z. I'm currently working on the Kaioken, which is just a red aura. However, what I seem to have so far does not seem to be working
So I ask, is this script correct?
script.Parent.MouseButton1Click:connect(function()
if jun.Character.Torso:findFirstChild("PwnFire") == nil then
local fr = game.lighting.ParticleEmitterKaioken:clone()
fr.Parent = jun.Character.Torso
end
EDIT: I have since edited the script with the advice of others, however. Now the problem is it doesn't toggle the particles, but rather duplicates them.
Here's the new script.
local jun = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
if jun.Character.Torso:findFirstChild("PwnFire") == nil then
local fr = game.lighting.ParticleEmitterKaioken:clone()
fr.Parent = jun.Character.Torso
end
if jun.Character.Torso["ParticleEmitterKaioken"].Enabled==true then
jun.Character.Torso["ParticleEmitterKaioken"].Enabled=false
else
jun.Character.Torso["ParticleEmitterKaioken"].Enabled=true
end
end)

2 comments
Is there an error in output?
It says: 20:00:06.912 - Players.DerpzGamez.PlayerGui.SSJ Gui.SSJGui.Kaioken.Kaioken:5: 'end' expected (to close 'function' at line 1) near ''