Hello, I am using this script:
local player = script.Parent.Parent.Parent.Parent.Parent
local money = player.leaderstats.Money
local itemstats = player.ItemStats.Item
local price = 350
local tool = game.Lighting:findFirstChild("DarkSword10")
local Box = script.Parent.Parent.Parent.Frame -- get the GUI to close
local function buy()
if money.Value >= price then
if itemstats.Value == 9 then
money.Value = money.Value - price
local a = tool:clone()
local text10 = script.Parent.TextButton
a.Parent = player.Backpack
local b = tool:clone()
b.Parent = player.StarterGear
itemstats.Value = 10
text10.Visible = true
Box.Visible = false -- here the code doesn't hide the GUI
end
end
end
script.Parent.MouseButton1Down:connect(buy)
This is a script (not local) in StarterGUI, as you can see at line 20 I set to Visible false but the GUI still appears. Thanks.
