Issue with my gui

So technically this script is supposed to make it so when you click a uranium block it makes a gui appear. But its not working, why?

local GotUranium = false
variables = require(game.ServerScriptService.Variables)
script.Parent.MouseClick:Connect(function(player)
	variables.CurrentUranium = variables.CutrentUranium+1
if variables.CurrentUranium >= 1 then
	GotUranium	= true
end
if GotUranium == true then
player.PlayerGui.CollectionBook.MainFrame.Uranium.Tick.Visible = true
end

end)

Are you getting on any errors in the output? If you put a print() within the “GotUranium == true” if statement on line 8, does it print?

I printed it and GotUranium = false :confused:

I see the issue: instead of saying CurrentUranium I said CutretUranium!

1 Like

Edit: its broken again and saying false.

@ExcessEnergy Still broken. It says false and does not show the gui. Have any idea what the issue is?

Could we see the rest of your setup, and maybe an explanation of how the system is supposed to work?

From what it looks like, “Variables.CurrentUranium >= 1” on line 5, is not coming back true, since GotUranium is printing false afterwards.

So technically, there is a click detector in a part you click: Screen Shot 2020-08-22 at 1.23.01 pm
After, it is supposed to enable this gui: Screen Shot 2020-08-22 at 1.23.57 pm

And thats pretty much all it does.