Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Detector script only works once after i close the gui it doesn't open again?

Script below is inside a chracter from workspace to open the gui from the player

local Clicker = script.Parent:WaitForChild("Clicker")
local TeamAllowed = {
	["Woo"] = true,
}

Clicker.ClickDetector.MouseClick:Connect(function(plr)
	if TeamAllowed[plr.Team.Name] then
		plr.PlayerGui.TeamShopTESTING.Main.Visible = true
		print("Working!!")
	end
end)

I click on it and the gui pops up after i close it by turning the frame Visible = false with a localscript from the Exit part of the gui, The Detector doesn't work again and i can't open the gui. I want to be able to open the gui again na inf amount of times but it just doesn't work.

I'm fairly new to scripting and i need some help.

2 comments

0

The detector script is on a character after you click him it opens the gui from the player

0

Formatted the code

1 answer

When the localscript turns the frame Visible to false, it turns it false only on the client's side. The server however, thinks Visible is still true. When you click again, the server sees that Visible is already true so it does not do anything. I might be wrong tho

1 comment

0

thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.