script:
local play = game.Workspace.GUIS.SurfaceGui.Frame.TextButton local fadeframe = game.StarterGui.Fade.Frame local tween = game:GetService("TweenService") local sound = play.Clicked local fade = tween:Create(fadeframe, TweenInfo.new(2, Enum.EasingStyle.Sine), {BackgroundTransparency = 0} ) play.MouseButton1Click:Connect(function() sound:Play() fade:Play() wait(1) print("workinbg!!?!") end)
StarterGui
is where PlayerGui
"templates" are being held. By using expression local fadeframe = game.StarterGui.Fade.Frame
you are referencing that template instead of actual PlayerGui.
To solve this please change it to:
local fadeframe = game.Players.LocalPlayer.PlayerGui:WaitForChild("Fade").Frame
This way you will reference actual frame that is on the screen. I added WaitForChild
since it is very likely this frame will not load before the script runs.