MouseButton1Click doesn't work

Hello, I am trying to make a skip button so when you press it the gui becomes transparent. I don’t get any errors and it doesn’t print anything.

loadingscreen.Background.Skip.MouseButton1Click:Connect(function()
	print("744")
	for count = 0, 1, 0.01 do
		wait(0.0000000000001)
		loadingscreen.Background.ImageTransparency = count
		loadingscreen.Background.Lading.TextTransparency = count
		loadingscreen.Background.Lading.TextStrokeTransparency = count
		loadingscreen.Background.Credit.TextTransparency = count
		loadingscreen.Background.Credit.TextStrokeTransparency = count
		loadingscreen.Background.Skip.TextTransparency = count
		loadingscreen.Background.Skip.BackgroundTransparency = count
		loadingscreen.Background.Skip.Roundify.ImageTransparency = count
		loadingscreen.Background.Skip.Shading.ImageTransparency = count	
	end
	loadingscreen:Destroy()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end)

Could you provide a video or GIF of it not working, and maybe also what the UI looks like in the explorer?

You are sure it is a button?? can you do a video??

1 Like

Show an output or give us a little bit of a better explanation.

robloxapp-20220717-1643421.wmv (982.0 KB)
Here is a video.

You try restart roblox studio or publish it, it looks like a bug, you are sure the script is loaded?? or first load the assets and next the game.

Try do it load before the assets.

Pls show all the Loading script for search if there is an error who do it stop.

The roundify image labels might be causing the problem. They might be blocking the mouse from clicking. Try setting the Active property to True for both those image labels.

You should try using MouseButton1Down ?

Already tried that before I posted. It still didn’t work.

script.Parent:RemoveDefaultLoadingScreen()
game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):SetTopbarTransparency(1)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu,false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)


local loadingscreen = script.LoadingMain
loadingscreen.Parent = game.Players.LocalPlayer.PlayerGui

local contentProvider = game:GetService("ContentProvider")
local ts = game:GetService("TweenService")

game.Loaded:Wait()
local toLoad = workspace:GetDescendants()

local totes = #toLoad

for i, v in pairs(toLoad) do
	loadingscreen.Background.Lading.Text = "Loading: "..i.."/"..totes.." "--.. v.Name
	contentProvider:PreloadAsync({v})
	if i >= 8000 then -- least amount of assets that are needed
		loadingscreen.Background.Skip:TweenPosition(UDim2.new(0.5,0.95,0.95))
		loadingscreen.Background.Lading:TweenPosition(UDim2.new(0.5,0.9,0.9))

	end
end

loadingscreen.Background.Skip.MouseButton1Click:Connect(function()
	print("744")
	for count = 0, 1, 0.01 do
		wait(0.0000000000001)
		loadingscreen.Background.ImageTransparency = count
		loadingscreen.Background.Lading.TextTransparency = count
		loadingscreen.Background.Lading.TextStrokeTransparency = count
		loadingscreen.Background.Credit.TextTransparency = count
		loadingscreen.Background.Credit.TextStrokeTransparency = count
		loadingscreen.Background.Skip.TextTransparency = count
		loadingscreen.Background.Skip.BackgroundTransparency = count
		loadingscreen.Background.Skip.Roundify.ImageTransparency = count
		loadingscreen.Background.Skip.Shading.ImageTransparency = count	
	end
	loadingscreen:Destroy()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end)

game.Workspace.Lobby.Parent = workspace
wait(0.1)
for count = 0, 1, 0.01 do
	wait(0.0000000000001)
	loadingscreen.Background.ImageTransparency = count
	loadingscreen.Background.Lading.TextTransparency = count
	loadingscreen.Background.Lading.TextStrokeTransparency = count
	loadingscreen.Background.Credit.TextTransparency = count
	loadingscreen.Background.Credit.TextStrokeTransparency = count
	loadingscreen.Background.Skip.TextTransparency = count
	loadingscreen.Background.Skip.BackgroundTransparency = count
	loadingscreen.Background.Skip.Roundify.ImageTransparency = count
	loadingscreen.Background.Skip.Shading.ImageTransparency = count
end
wait(0.5)
loadingscreen:Destroy()
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)

Try it:

It works because in your version you do it first wait things to load and next if button clicked, the button in the old version work when you finish loading all, but it isnt what do you want.

script.Parent:RemoveDefaultLoadingScreen()
game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui"):SetTopbarTransparency(1)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu,false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)


local loadingscreen = script.LoadingMain
loadingscreen.Parent = game.Players.LocalPlayer.PlayerGui

local contentProvider = game:GetService("ContentProvider")
local ts = game:GetService("TweenService")

game.Loaded:Wait()

loadingscreen.Background.Skip.MouseButton1Click:Connect(function()
	print("744")
	for count = 0, 1, 0.01 do
		wait(0.0000000000001)
		loadingscreen.Background.ImageTransparency = count
		loadingscreen.Background.Lading.TextTransparency = count
		loadingscreen.Background.Lading.TextStrokeTransparency = count
		loadingscreen.Background.Credit.TextTransparency = count
		loadingscreen.Background.Credit.TextStrokeTransparency = count
		loadingscreen.Background.Skip.TextTransparency = count
		loadingscreen.Background.Skip.BackgroundTransparency = count
		loadingscreen.Background.Skip.Roundify.ImageTransparency = count
		loadingscreen.Background.Skip.Shading.ImageTransparency = count	
	end
	loadingscreen:Destroy()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end)

local toLoad = workspace:GetDescendants()

local totes = #toLoad

for i, v in pairs(toLoad) do
	loadingscreen.Background.Lading.Text = "Loading: "..i.."/"..totes.." "--.. v.Name
	contentProvider:PreloadAsync({v})
	if i >= 8000 then -- amount of assets that are needed
		loadingscreen.Background.Skip:TweenPosition(UDim2.new(0.5,0.95,0.95))
		loadingscreen.Background.Lading:TweenPosition(UDim2.new(0.5,0.9,0.9))

	end
end

game.Workspace.Lobby.Parent = workspace
wait(0.1)
for count = 0, 1, 0.01 do
	wait(0.0000000000001)
	loadingscreen.Background.ImageTransparency = count
	loadingscreen.Background.Lading.TextTransparency = count
	loadingscreen.Background.Lading.TextStrokeTransparency = count
	loadingscreen.Background.Credit.TextTransparency = count
	loadingscreen.Background.Credit.TextStrokeTransparency = count
	loadingscreen.Background.Skip.TextTransparency = count
	loadingscreen.Background.Skip.BackgroundTransparency = count
	loadingscreen.Background.Skip.Roundify.ImageTransparency = count
	loadingscreen.Background.Skip.Shading.ImageTransparency = count
end
wait(0.5)
loadingscreen:Destroy()
game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
1 Like

Could issue could be the Roundify Effect you have on the Button ? Usually when I use that Plugin on a UI Element I can’t alter any of its properties afterwards.

Try using the instance UICorner instead of using Roundify, it might be blocking mouse clicks to your skip button.

Yeah I completely forgot UIcorners existed.