I've been trying to make a gui allowing players to use transformations from Dragon Ball Z and I decided to start by trying to make what should be the simplest, the Kaioken. I have had success in making the toggle button activate the Kaioken's aura... But clicking the button again doesn't remove the aura but rather duplicates it.
Here's the code.
local jun = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
if jun.Character.Torso:findFirstChild("PwnFire") == nil then
local fr = game.lighting.Kaioken:clone()
fr.Parent = jun.Character.Torso
end
if jun.Character.Torso["Kaioken"].Enabled==true then
jun.Character.Torso["Kaioken"].Enabled=false
else
jun.Character.Torso["Kaioken"].Enabled=true
end
end)

1 comment
:findFIrstChild is deprecated, so as :connect. Also, make variables mean something.