Mouse button 1 click doesn’t work even when I change the script a lot:
It is a text button.
Solutions I have tried:
Checking if it is being covered by another gui
Restarting studio
Checking if its a local script (which it is)
Checking if its the right button (it is)
Checking if its a button (i have)
Checking output for anything
Making the ZIndex high
It works for every other button but i dont know why it doesnt work for this one
StarterGUI.CharacterCustomization.CustomizationFrame.ExitButton.MouseButton1Click:Connect(function()
print("Exit")
StarterGUI.CharacterCustomization.CustomizationFrame.Visible = false
MainUI.PlayerStatsBackground.Visible = true
Process = false
updateStats()
end)
2 Likes
Is it initialized yet?
It could be a problem where the button is not fully loaded.
Any errors appear when you start studio, from the local script that manages the button?
EDIT: the problem is caused by you wrongly accessing starter gui instead of player gui as @CZXPEK and @MrSheriff_RBLX said.
3 Likes
CZXPEK
(czo)
April 25, 2025, 10:00pm
3
adz2k:
StarterGUI.
youre checking for clicks on the button thats in StarterGui
when your character spawns all UI gets cloned from StarterGui to LocalPlayer.PlayerGui
local PlayerGui = game:GetService("Players").LocalPlayer.PlayerGui
PlayerGui.CharacterCustomization.CustomizationFrame.ExitButton.MouseButton1Click:Connect(function()
print("Exit")
StarterGUI.CharacterCustomization.CustomizationFrame.Visible = false
MainUI.PlayerStatsBackground.Visible = true
Process = false
updateStats()
end)
2 Likes
i think it’s because you’re referencing the button directly from StarterGui
and not from PlayerGui
you should reference all your gui instances through PlayerGui
for them to function properly
try replacing StarterGUI
with game.Players.LocalPlayer.PlayerGui
and see if it fixes your problem
2 Likes
You’re right, the button wasn’t loading, and the player gui notice helped as well, thank you!
system
(system)
Closed
May 14, 2025, 6:13pm
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.