I have made a screen gui image button that when clicked it prints “Purchased”, but nothing is printed. Do anyone know this issue?
We can’t help with your issue if you don’t provide the code
But as an additional info, i put this code inside a local script, and i put the button inside a scrolling frame
Looks like it should work, is there any other code above the code you just sent? If so, show that as well as it could be that someone is stopping the code from creating the event.
Do you get any errors when you run the game that lead to the localscript?
Neither the code it written with another, nor the code gives me error (Don’t mind my grammmar)
Wait, is it a GuiButton? It should work with it.
if it’s a gui button try using
script.Parent.Activated:Connect(function()
If you have an output you can see it printed.
There may be an invisible (Visible but transparency is 1) Gui blocking in-front of it.
Probably you put loops in above that code which creates a yield, that’s why the event doesn’t assigned at all. That’s why it didn’t printed.
Have you tried setting it’s ZIndex
and LayoutOrder
to a high number, and enabled Active
in properties? Another UI may be blocking it.
With all the information you have given, there is no reason for it not to work. Is gui in workspace? Then it wouldnt work.
The gui is in the starter gui and it is srolling fram, inside it image button with local script
I didn’t check the first two, but the last one which is “Active” i checked it and it is true
I only wrote
script.Parent.MouseButton1Click:Connect(function()
-- my scripts
end)
No there isn’t anything, the button is colored in gray when i hover, but when i click on it it doesn’t do anything
That should be working. As a script itself it’ll be working but it’s conflicting with something else.
Can you send a picture of the hierarchy and also any other scripts involved?
I didn’t work either, it maybe from the gui or something