So I'm getting frustrated on my script, its not working but there are not error even when i reload the script nothing is happening. I made a fading frame that I parented towards a gui, I made the frame that was inside the gui visible and change the background transparency with the help of a local script from another gui. I tried testing it and nothing was working, so if you could redo or fix the script it would be very thankful. ALSO DO NOT HATE ME FOR NOT USING LOOPS AS I TRIED THAT AND NOTHING HAPPENED
Also if you really really need more information then here is the game link: https://web.roblox.com/games/3171457814/Fred-bear-And-Friends-Family-Diner#!/about
Here is the script
local playergui = game.Players.LocalPlayer.PlayerGui local player = game.Players.LocalPlayer local character = player.Character local camera = workspace.CurrentCamera local PlayerGui = player.PlayerGui local hum = character:WaitForChild("Humanoid") local StarterGui = game:GetService("StarterGui") local black = script.Parent.Parent.Parent.BlackFadingGui.Frame local playergui = game.Players.LocalPlayer.PlayerGui script.Parent.MouseButton1Click:Connect(function(player) black.Parent = StarterGui.BlackFadingGui black.BackgroundTransparency = 0.1 black.BackgroundTransparency = 0.2 black.BackgroundTransparency = 0.3 black.BackgroundTransparency = 0.4 black.BackgroundTransparency = 0.5 black.BackgroundTransparency = 0.6 black.BackgroundTransparency = 0.7 black.BackgroundTransparency = 0.8 black.BackgroundTransparency = 0.9 black.BackgroundTransparency = 1 repeat wait(0.1) camera.CameraType = Enum.CameraType.Scriptable until camera.CameraType == Enum.CameraType.Scriptable camera.CFrame = workspace.CameraPosition2.CFrame script.Parent.Visible = false wait(0.1) playergui.CharacterSelectionGui.Frame.Visible = true end) script.Parent.MouseEnter:Connect(function() script.Parent.BackgroundTransparency = .5 end) script.Parent.MouseLeave:Connect(function() script.Parent.BackgroundTransparency = 1 end) hum.Died:Connect(function() script.Parent.Visible = false wait(0.01) script.Parent.Visible = true wait(0.01) script.Parent.Visible = true end)
Your problem is here:
black.BackgroundTransparency = 0.1 black.BackgroundTransparency = 0.2 black.BackgroundTransparency = 0.3 black.BackgroundTransparency = 0.4 black.BackgroundTransparency = 0.5 black.BackgroundTransparency = 0.6 black.BackgroundTransparency = 0.7 black.BackgroundTransparency = 0.8 black.BackgroundTransparency = 0.9 black.BackgroundTransparency = 1
To us it might seem like it works but the script actually does this so fast that you see it as instant. To fix this, you need to do a for loop and a wait.. Though you could just put wait(0.1) in between those lines but a better way to do it is like this:
for i = 1, 10 do black.BackgroundTransparency = black.BackgroundTransparency + 0.1 wait(0.1) end