UI only appears once when clicked

  1. What do you want to achieve?

What I am trying to achieve is so when the player clicks on a part, a UI pops up with the part’s information.

  1. What is the issue?

The problem is that it only works once. So, basically if one of the parts is clicked for the first time, it appears. But, close out of it and click on it again, it doesn’t work.

  1. What solutions have you tried so far?

I have tried using local scripts and using the function :GetPropertyChangedSignal so when the text changes, it appears. This method has worked, but the UI didn’t appear when it was clicked on again, on the same part. I looked on the Developer Hub but that didn’t help.

local building = script.Parent

building.ClickDetector.MouseClick:Connect(function(player)
	local PlayerGUI = player.PlayerGui
	local MenuUI = PlayerGUI.MenuUI
	for i, v in pairs(require(game.ReplicatedStorage.Scripts.UtilityAssets)) do
		if script.Parent.Name == v[1] and script.Parent.Type.Value == "Electricity" then
			MenuUI.PowerStationFrame.Visible = true
		end	
	end
end)
1 Like

Looks like a replication issue on your end.

The server prompts open the menu. The client closes it.

However, the server still thinks it’s visible. Remember, client changes aren’t replicated to the server. So while it’s not visible for you, the server still thinks it does.

@VibeOnRobl0x the hell is that chatgpt reply my guy

bro actually deleted it :skull:

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