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

ImageButton in a surfacegui script; does nothing; no error?

Asked by
iiKind 13
7 years ago
Edited 7 years ago

inside a local script in a image button

local Player = game.Players.LocalPlayer
local ID = 1225234267

script.Parent.MouseButton1Click:connect(function(click)
    game:GetService("MarketplaceService"):PromptPurchase(Player,ID)
end)

the problem is, it does nothing, no error message, nothing. I want it to prompt purchase when a player clicks it, any tips or ideas?

2 answers

Log in to vote
0
Answered by 7 years ago

http://wiki.roblox.com/index.php?title=API:Class/SurfaceGui/Adornee

Parent the surfaceGui and all its children in the playergui (or startergui) and set the surfaceGui’s Adornee property to the part.

0
What the heck....... this is so irrelevant greatneil80 2647 — 7y
0
No, its the answer. Look at the page for adornee, and things have to be in the players gui for it to work with clicks etc NexanianStudios 91 — 7y
0
Adornee: sets what the surface gui is attached to NexanianStudios 91 — 7y
0
Mouse input requires the object to be in a client-sided object. Workspace is not client sided, but NexanianStudios 91 — 7y
View all comments (3 more)
0
PlayerGuis is. This is the one reason why the adornee property even exists. You cant get mouse input because the mouse doent exist in the workspace. NexanianStudios 91 — 7y
0
Works perfectly, thanks! iiKind 13 — 7y
0
No problemo NexanianStudios 91 — 7y
Ad
Log in to vote
0
Answered by
FazNook 61
7 years ago
Edited 7 years ago

I dont know what you did wrong here, your script works fine. I have tested your script. I've also added in the explorer to let you know how the objects are placed.

I hope this helps you, make sure to upvote if it does. Thank you!

Answer this question