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)
1 Like
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?
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)
1 Like
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
1 Like