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

Why is my localscript inside of my ImageButton not running?

Asked by 2 years ago

So, for the past hour or so, I have been having this random thing happening with an ImageButton. When you hover over the button, it should make a Click Sound and a TextLabel should appear, and whenever you click the button, it enables a GUI and makes the frame in that GUI visible.

For some reason, when I logged on today to test it out, it wasn't working. There were no errors in the output, and nothing glitched or anything.

The LocalScript is located inside of the ImageButton, which is Located in the ScreenGui.

This is all that is in my LocalScript:

local lobbiesGui = script.Parent.Parent.Parent.Parent:WaitForChild("LobbiesGui")

script.Parent.MouseEnter:Connect(function()
    script.Parent.Select_Sound:Play()
    script.Parent.Text.Visible = true
    print("MenuMouseEnter")
end)

script.Parent.MouseLeave:Connect(function()
    script.Parent.Select_Sound:Play()
    script.Parent.Text.Visible = false
    print("MenuMouseLeave")
end)

script.Parent.MouseButton1Click:Connect(function()
    script.Parent.Text.Visible = false
    script.Parent.Parent.Parent.Parent.LobbyGui2.Enabled = true
    script.Parent.Parent.Parent.Parent.LobbyGui2.PartyGuiFrame.Visible = true
    script.Parent.Parent.Parent.Enabled = false
    print("MenuMouseClick")
end)

Any Help on this?

0
please tell me that the variable has nothing to do with the script itself Doraemon4680 0 — 2y

Answer this question