GUI Button Detection not working

So, the GUI buttons aren’t working in Test
The code:

BeginPack.GoodLuck.Begin.MouseButton1Down:Connect(function()

print "It works"

end)

Everything is activated and enabled and everything. Nothing comes out

You didn’t define “BeginPack” (I hate 30 chars limit)

Are you getting any errors mate?

This is a local script, right?

I think he did but didn’t show it.

@DarkDanny04 It is, and @Kamlkaze_Kid, I did define BeginPack. It’s just game.StarterGui

Ah, there’s the issue. You need to define it using PlayerGui

1 Like

Have you used a :WaitForChild?

I did that originally when I defined it as

local BeginButton = GUIPack.Begin.Frame.GoodLuck:WaitForChild("Begin")

Like I said, I did define it.
(30 chars is stupid)

U used StarterGui not PlayerGui

Try restarting roblox studio i don’t know if that will work, but it might.

No, no, I mean by defining it using startergui, the game is waiting for you to click the button in startergui. You need to define it like this. (If you have player defined already, just omit the first line)

local player = game.Players.LocalPlayer
local BeginPack = player.PlayerGui.--Add the rest of the path to your GUI here

Oh, and you will probably want to use a WaitForChild()

I don’t think you know how Guis work. I used StarterGui back when doing a dialogue script and it worked perfectly.

Oh wait, I’m stupid, nvm I can use script.Parent and put it in a folder :V
edit: That was what I did last time for my Dialogue Script