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

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

Asked by 5 years ago
Edited 5 years ago

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.

0
You have added a question mark on line 10, remove that. And by the way, connect is deprecated, use Connect instead. TheOnlySmarts 233 — 5y

1 answer

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

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)
0
Ermm, what is the difference? TheOnlySmarts 233 — 5y
0
Thanks, XcrossyYTBackup. Also the only smarts thank you for helping me too. The script works Now. Both of you solved it. sbob12345m 59 — 5y
0
@Smarts, he removed the question mark, thats what the output said tonyv537 95 — 5y
Ad

Answer this question