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

How do I make this to allow clickable in surface GUI?

Asked by 4 years ago

I have this in SurfaceGui.Frame then inside frame, I have the image button. Am I doing something wrong? I does work in regular GUI. but when I put it into surface GUI, it doesn't work.

I can't click on the button and trigger the service.

local player = game.Players.LocalPlayer
local a = script.Parent  
local click = script:WaitForChild('click')
local donation = {a:WaitForChild('donate1'), a:WaitForChild('donate2'), a:WaitForChild('donate3'), a:WaitForChild('donate4'), a:WaitForChild('donate5'), a:WaitForChild('donate6')}

donation[1].MouseButton1Down:connect(function()
        click:Play()
        game:GetService("MarketplaceService"):PromptPurchase(player, 610567902)--5
        end)

donation[2].MouseButton1Down:connect(function()
        click:Play()
        game:GetService("MarketplaceService"):PromptPurchase(player, 610568306)--15
        end)

donation[3].MouseButton1Down:connect(function()
        click:Play()
        game:GetService("MarketplaceService"):PromptPurchase(player, 610568669)--50
        end)

donation[4].MouseButton1Down:connect(function()
        click:Play()
        game:GetService("MarketplaceService"):PromptPurchase(player, 610568976)--100
        end)

donation[5].MouseButton1Down:connect(function()
        click:Play()
        game:GetService("MarketplaceService"):PromptPurchase(player, 289466449)--500
        end)

donation[6].MouseButton1Down:connect(function()
        click:Play()
        game:GetService("MarketplaceService"):PromptPurchase(player, 289465496)--1000
        end)
0
make sure all the frames and surfacegui have the active property enabled MachoPiggies 526 — 4y
0
Is the SurfaceGui in a part or StarterGui? The SurfaceGui needs to be in StarterGui or PlayerGui and have its adornee in properties set to the part to be interactable. User#20279 0 — 4y
0
Its in a part. How to do I do that? Asher0606 36 — 4y

Answer this question