Why does the image button not work?

image
image

1 Like

It looks like you have a space between the game:GetService(“MarketplaceService”) and the :PromptGamePassPurchase() part, remove the space and see if it works then. :slight_smile:

1 Like

still not :confused:
image
but when i get on other button this appears and with this button not
image

1 Like

If your LocalScript is a descendant of Workspace, it won’t run at all. You should also be handling gamepass purchases on the server, not on the client. You can achieve this by using RemoteEvents.

1 Like

i’m able to buy game passes on other buttons, and i put the surface gui with the image button in startergui?

1 Like

I just tested it and it turns out what I said in my previous reply is partially incorrect. I’m also unable to get input from the ImageButton from a SurfaceGui while it’s parented to the part (I believe this is expected behavior), or when parenting it to StarterGui and set the adornee to a part.

image
can it be a model?

SurfaceGuis don’t detect player input unless they’re in PlayerGui.

1 Like

on a way i don’t have playergui?

What do you mean? I don’t understand

is it starterplayer? or i’m dumb?

Oh, I see. Put it in StarterGui

image
this or?

Yeah, I see what you mean. Put it in StarterGui

No that isn’t StarterGui can you screenshot your explorer?

It is a child of “game” if you get what I mean.

That’s not what they meant, they were asking where to put it I think. They know those aren’t StarterGui

image
its gone now


the part is deleted?

image
i puted the basic part or the board at this situation in a model and the surfaceGui of the part into starterGui now it work

You want to keep your part in the workspace but have the surface gui in StarterGui. You can then set the adorned property of the surface gui back to the part.

Nvm you got it :+1:t2:

1 Like