Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[Script Fixed] How to fix a GUI to make it become visible when its told too?

So I scripted this local script in my shop GUI to pop up when you click it. (there are four parts to the shop GUI; Swords, Effects, and Coins). So that way when you click one of the (Swords, Effects, and coins) GUIs the list of items would pop up. I thought I got everything right when I received an error message in my output window:

17:27:43.681 - Players.sbob12345m.PlayerGui.Shop.Frame.Swords.LocalScript:10: unexpected symbol near '?'

So I went into the local script and it brought me to line 10 of this script:

button = script.Parent.Parent.Swords
image = script.Parent.Parent.Sword
visible = false

button.MouseButton1Down:connect(function()
 if visible == false then
  image.Visible = true
  visible = true
end
end)?

What did I do wrong? if you need more details on my GUI just comment so I'll give a detailed list of how I put this together. thanks.

2 comments

0

You have added a question mark on line 10, remove that. And by the way, connect is deprecated, use Connect instead.

1 answer

✓ Accepted answer

Try this if it don't work tell me

button = script.Parent.Parent.Swords
image = script.Parent.Parent.Sword
visible = false

button.MouseButton1Down:connect(function()
 if visible == false then
  image.Visible = true
  visible = true
end
end)

3 comments

0

Ermm, what is the difference?

0

Thanks, XcrossyYTBackup. Also the only smarts thank you for helping me too. The script works Now. Both of you solved it.

0

@Smarts, he removed the question mark, thats what the output said

This discussion is preserved as it was. New answers, comments, and votes are closed.