Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

There are no errors and everything is right but a imagebutton's MouseButton1Down wont fire?

Asked by 5 years ago
local StarterGui =
 game:GetService("StarterGui")

local MainMenu = StarterGui:WaitForChild("Main Menu")
local Menu = MainMenu:WaitForChild('Menu')
local PlayButton = Menu.PlayGui
print(PlayButton.Parent)-- I even checked to see what the parent of it was and it was right it returned in the output Menu 
PlayButton.MouseButton1Down:Connect(function()
print('sad')
end)

so what is wrong with this script?

0
Is it a local script? DeceptiveCaster 3761 — 5y
0
obviously HalsCreative -14 — 5y
0
You are getting the GUI from the StarterGui what you have to do is find the GUI from the player GUI by doing this, game.Players.LocalPlayer.PlayerGui then access the GUI from there User#7446 0 — 5y

Answer this question