Thank you in advance for answering. I have started scripting some days ago so if my question already has an obvious answer, then I apologize for my ignorance.
-
What do you want to achieve?
I want to make that BackgroundTransparency appears ONLY after the menu opens -
What is the issue?
The BackgroundTransparency is running when the menu it isn´t open
-
What solutions have you tried so far?
I have search for the answer in videos and in the forum but I haven´t find this specifically answer
--//Services//--
local Tween = game:GetService("TweenService")
--//Frame Variables//--
local CharacterSelectFrame = script.Parent:WaitForChild("CharacterSelectFrame")
--//Variables//--
local NCS = CharacterSelectFrame:WaitForChild("NarutoCharacterSelect")
local NCI = CharacterSelectFrame:WaitForChild("NarutoCharacterImage")
local NCB = CharacterSelectFrame:WaitForChild("NarutoCharacterBelow")
local SelectCharacter = script.Parent:WaitForChild("SelectCharacter")
local CSFIsOpen = false
--//Tweens//--
local CSFPopIn = Tween:Create(CharacterSelectFrame, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {Transparency = 0.5})
local CSFPopOut = Tween:Create(CharacterSelectFrame, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {Transparency = 1})
local NCSPopIn = Tween:Create(NCS, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {TextTransparency = 0})
local NCSPopOut = Tween:Create(NCS, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {TextTransparency = 1})
local NCIPopIn = Tween:Create(NCI, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {ImageTransparency = 0})
local NCIPopOut = Tween:Create(NCI, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {ImageTransparency = 1})
local NCBPopIn = Tween:Create(NCB, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {TextTransparency = 0})
local NCBPopOut = Tween:Create(NCB, TweenInfo.new(0.3, Enum.EasingStyle.Sine), {TextTransparency = 1})
--//SelectCharacter//--
SelectCharacter.MouseButton1Click:Connect(function()
CSFIsOpen = not CSFIsOpen
if CSFIsOpen then
--//Open//--
CSFPopIn:Play()
NCSPopIn:Play()
NCIPopIn:Play()
NCBPopIn:Play()
else
--//Close//--
CSFPopOut:Play()
NCSPopOut:Play()
NCIPopOut:Play()
NCBPopOut:Play()
end
end)
NCI.MouseEnter:Connect(function()
NCI.BackgroundTransparency = 0.5
end)
NCI.MouseLeave:Connect(function()
NCI.BackgroundTransparency = 1
end)