Computer Problem

Another error alert! So I’ve been trying to create a game where you sell children for money. The babies are turned into a leaderstat of their own and then you have to turn on the pc and sell them for the babies to turn into the money leaderstat. The scripts work fine at first, but when I disable the gui using a script and try to enable it again, it wont work. These are my 2 scripts.

local screen = script.Parent
local click = screen.Click

click.MouseClick:Connect(function(player)
	player.PlayerGui.PCGui.Enabled = true
	if player.PlayerGui.PCGui.Enabled == false then
		player.PlayerGui.PCGui.Enabled = true
	end
end)

^^ Gui Enabler

-- Services
-- Gui
local button = script.Parent
local Gui = button.Parent
-- Other

button.MouseButton1Click:Connect(function()
	Gui.Enabled = false
end)

^^ Gui Disabler

1 Like

Firstly - That is an odd-sounding game idea.

Second - I assume you are disabling it via server script when it doesn’t work? You can fix that either by moving it to a local script as well, or by replacing

player.PlayerGui.PCGui.Enabled = true

with

player.PlayerGui.PCGui.Enabled = false
task.wait()
player.PlayerGui.PCGui.Enabled = true
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.