Click Detector GUI Not Working

  1. What do you want to achieve?
    I would like to make it so if you click a click detector and a value in replicated storage is true, a GUI appears on the player’s screen.

  2. What is the issue?
    Issue A: GUI Shows up if the value is false.
    Issue B: If the value is true it wont show up but registers the click and says its showing with print statement.

  3. What solutions have you tried so far?
    I’ve tried fixing it myself and seeing if anyone has had a similar issue.

--This script is in ServerScriptService
game.Workspace:WaitForChild("BigBox"):WaitForChild("ClickDetector").MouseClick:Connect(function(Player)
	print(Player.Name.." Clicked")
	if game.ReplicatedStorage:WaitForChild("Values"):WaitForChild("Box").Value == true then
		print("Value Is True")
		if Player.PlayerGui:WaitForChild("BigBoxGui").Enabled == false then
			print("Showing GUI")
			Player.PlayerGui:WaitForChild("BigBoxGui").Enabled = true
		else
			print("Taking Away GUI")
			Player.PlayerGui:WaitForChild("BigBoxGui").Enabled = false
		end
	else
		print("Value Is Not True")
	end
end)

Video to visualize where stuff is at and what I am doing:

1 Like

Solved

Note To Self:
Don’t write a function and forget about it and then write the same function again, causing them to fight against each other creating the issue seen in the video.

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