So i was making a frame fade and all of a sudden it never appears or fades it just ignores the script, I saw and I guarantee you there was no errors whatsoever so if anyone could help and try to fix the script I would be glad.]

Here's 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 black = script.Parent.Parent.Parent.BlackFadingGui.Frame
local playergui = game.Players.LocalPlayer.PlayerGui
script.Parent.MouseButton1Click:Connect(function(player)
	local blackclone = black:Clone()
	
	blackclone.Parent = PlayerGui
	
	
	blackclone.BackgroundTransparency = 0.1
	wait(0.01)
	blackclone.BackgroundTransparency = 0.2
	wait(0.01)
	blackclone.BackgroundTransparency = 0.3
	wait(0.01)
	blackclone.BackgroundTransparency = 0.4
	wait(0.01)
    blackclone.BackgroundTransparency = 0.5
    wait(0.01)
    blackclone.BackgroundTransparency = 0.6
    wait(0.01)
    blackclone.BackgroundTransparency = 0.7
    wait(0.01)
	blackclone.BackgroundTransparency = 0.8
	wait(0.01)
	blackclone.BackgroundTransparency = 0.9
	wait(0.01)
	blackclone.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)
	  
	        
	        
	
	local fadingclone = playergui.BlackFadingGui.Frame:Clone()
	fadingclone.Parent = playergui.BlackFadingGui

	

	        

	  

	
	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)

 

3 comments

0

Please learn how to use loops

0

Why do you have 6 blank newlines? Also make prints around your code to see if parts are running and your variables are what they should be

0

I know i tried a loop and nothing worked, can you help me fix the script though?