When Im using MouseButton1Click its not working

Even when I use the script in the GUI It doesn’t work

StarterPlayerScripts maybe?
Or idk…

Try finding another post similliar like this.
Maybe those one can solve yours

The way he designed his script, as long as it runs it will look up the gui that it needs to connect to.

I think i know the problem. The problem is the connection to the gui, put the script undr the gui and see if that works. Just try that and lmk if it works, if u cant do that, find the gui from player gui by doing game.players.localplayer.playergui.gui

bro I would have never known…

Blockquote

Alright. I’ve narrowed down the issue to one particular object: Phone
image
Switch the object to be an ImageLabel, instead of an ImageButton, and your code should be working!

The reason it was stopping the code from running, was because the image button covered the whole screen (and hence all of the buttons). Because of the way the screenGUI is set up, it took priority over the other buttons, and intercepted all of the presses to it. By changing the type from ImageButton to ImageLabel, it prevented it from being able to intercept presses, allowing for the presses to go to the buttons below and hence activating the code!

edit1: (also, use .Activated - it will work better on mobile devices)
edit2: The tested code was what was provided in the original post, but with the 2nd line commented out as you did not provide that part of the GUI, so it caused an error.
edit3: added an explanation

Maybe try changing the ZIndex method from Sibling to Global? (Property of ScreenGui)

I usually prefer global since I don’t have to figure out how sibling works. Global just says “Number with highest value goes to the front.”

Remember to check all of the frames. If one frame has the Active property, it might block inputs to the button. Additionally, you must make sure that no button that is fully transparent is blocking it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.