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

The shop GUI opens in studio but not in the actual game??

Asked by 6 years ago
Edited 6 years ago

Hi I'm made a shop GUI. All the buttons work like giving you the item and taking away the points but for some reason the GUI will only open in studio not the published game.

Cheers

This is the code to open and close the Shop.

Button = script.Parent
ok = script.Parent.Parent.ok
Open = true

function OnButtonClick()
    if Open == true then
    Button.Text = "Close"
    ok.Visible = true
    Open = false
elseif Open == false then
    Button.Text = "Shop"
    ok.Visible =  false
    Open = true
    end

    end

script.Parent.MouseButton1Down:connect(OnButtonClick)
0
Try changing the last line, line 18 to, script.Parent.MouseButton1Click:connect(OnButtonClick) I hope this works. CrimsonFlux 6 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I suggest just changing the function to Button.MouseButton1Click:connect(function(). You would also be able to remove the final line at the end using this.

Ad

Answer this question