Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Frame dosent go trasparent?

I am making an event witch should fire once clicked but it dosent work i get no errors and i think the problem is in the tween service 1 script

local ts = game:GetService("TweenService")
local balckout = game.StarterGui.StartMenu.BlackOut
local tweeninfo = TweenInfo.new(1,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
local properties = {BackgroundTransparency = 0,
}
local create = ts:Create(balckout,tweeninfo,properties)

game.ReplicatedStorage.blackout.OnClientEvent:Connect(function()
	create:Play()
	end)

2 script

script.Parent.MouseButton1Click:Connect(function(hit)
game.ReplicatedStorage.blackout:FireServer()
end)

3 comments

0

Are you trying to make a visible script or a fade script

0

fade

0

oke one sec

1 answer

✓ Accepted answer

You can useTweenService but here is a more easier way of doing so without it.

All you can do, since your are using a button, is make a MouseButton1Click:Connect(function() and add a for loop.

Here is an example of a fade out button

local Frame = script.Parent.Parent.Frame

script.Parent.Button.MouseButton1Click:Connect(function()
	for i = 1, 10 do
		wait(0.1)
		Frame.BackgroundTransparency = i
	end
end)

Here is a way using TweenService

local Frame = script.Parent.Parent.Frame

local easeStyle = Enum.EasingStyle.Quint
local easeDirection = Enum.EasingDirection.In
local info = TweenInfo.new(3 , easeStyle , easeDirection)

local goal = {
    Transparency = 0.2 --Change to whatever
    BackgroundColor3 = Color3.new(1 , 1 , 1) --Change Color
}

local TweenService = game:GetService('TweenService')
local tween = TweenService:Create(Frame , info , goal)

tween:Play()

This discussion is preserved as it was. New answers, comments, and votes are closed.