Frame wont change it's transparency via localscript

  1. What do you want to achieve? I want to make the whole menu fade away when i click the play button.

  2. What is the issue? The frame will not fade away with the rest.


    As you saw in the video everything disappeared except for the background (the frame in question) then cuts to the game (The script disabled the ScreenGui)

  3. What solutions have you tried so far? I’ve changed the script a little and restarted studio.

Here is my script:

local ts = game:GetService("TweenService")

local frame = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Load"):WaitForChild("Frame")

local tweenInfo = TweenInfo.new(
	1,
	Enum.EasingStyle.Quint,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local tween = ts:Create(frame, tweenInfo, { Transparency = 1 }) --This is the part where the script fades the background.
local tween2 = ts:Create(frame.Menu.plau, tweenInfo, {ImageTransparency = 1})
local tween3 = ts:Create(frame.Menu.plau, tweenInfo, {BackgroundTransparency = 1})
local tween4 = ts:Create(frame.Menu.plau.TextLabel, tweenInfo, {TextTransparency = 1})
local tween5 = ts:Create(frame.Menu.creduts, tweenInfo, {Transparency = 1})
local tween6 = ts:Create(frame.Menu.title, tweenInfo, {Transparency = 1})
local tween7 = ts:Create(frame.Menu.option, tweenInfo, {Transparency = 1})
local tween8 = ts:Create(frame.Menu.rgt, tweenInfo, {Transparency = 1})
local tween9 = ts:Create(frame.Menu.TextLabel, tweenInfo, {Transparency = 1})

--script.Parent.MouseEnter:Connect(function()
--end)

--script.Parent.MouseLeave:Connect(function()
--end)


script.Parent.MouseButton1Click:Connect(function()
	--game.ReplicatedStorage.anchor:FireServer(game.Players.LocalPlayer)
	tween:Play() --This is the part where it plays the tween when the button is clicked
	tween2:Play()
	tween3:Play()
	tween4:Play()
	tween5:Play()
	tween6:Play()
	tween7:Play()
	tween8:Play()
	tween9:Play()
	task.wait(1)
	--game.ReplicatedStorage.GiveWeapon:FireServer(game.Players.LocalPlayer)
	game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Load").Enabled = false
end)
1 Like

Could you get more specific?
I don’t understand, I’ve played the video over 5 times I still can’t specifically understand what dissapeared. I can see everything dissapear and your cursor seems normal.

The gray background wont disappear.

Is it the one at the bottom? I am confused. I don’t see any gray background, is it big? :eyes:

Its simple

-- Change this
local tween = ts:Create(frame, tweenInfo, { Transparency = 1})
-- To this
local tween = ts:Create(frame, tweenInfo, {BackgroundTransparency = 1})

It still does the same problem.

Its the one behind everything.

Instead of using multiple tweens, you can use a for i loop.


local tweenInfo = TweenInfo.new(
	1,
	Enum.EasingStyle.Quint,
	Enum.EasingDirection.Out,
	0,
	false,
	0
)

local function tween(item, property)
       local TweenService = game:GetService("TweenService")
TweenService:Create(item, tweenInfo, property):Play()
end
script.Parent.MouseButton1Click:Connect(function()
for i,v in pairs(frame:GetDescendants()) do
     if v:IsA("Frame") then
             tween(v, {BackgroundTransparency = 1})
       end 
if v:IsA("ImageLabel") then
             tween(v, {ImageTransparency = 1, BackgroundTransparency = 1})
       end 
if v:IsA("TextLabel") then
             tween(v, {TextTransparency = 1, BackgroundTransparency = 1})
       end 

end
end
1 Like

Well, try this

-- Change this to
local frame = game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Load"):WaitForChild("Frame")
-- This
local frame = script.Parent.Frame

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.