I made a script that opened and closed a gui every time you clicked a button, it worked. I needed the same script for a different button, so I duplicated the script and put it in a different button and made a few changes to make a different gui appear. For some reason however, the copy of the script wont work, and it gives me an error that says:
CreateTerritoryGui is not a valid member of PlayerGui "Players.Paczki_TCBC.PlayerGui"
(CreateTerritoryGui is the gui I'm trying to make appear, and Paczki_TCBC is my username.)
here is the script that did work:
local Or = 1 local button = script.Parent local editor = button.Parent.Parent.Editor editor.Enabled = false button.MouseButton1Up:Connect(function() Or = Or * -1 if Or == -1 then editor.Enabled = true elseif Or == 1 then editor.Enabled = false end end)
and here is the one that did not work:
local choice = 1 local button = script.Parent local editor = button.Parent.Parent.CreateTerritoryGui editor.Enabled = false button.MouseButton1Up:Connect(function() choice = choice * -1 if choice == -1 then editor.Enabled = true elseif choice == 1 then editor.Enabled = false end end)
i think there is a book gear is able to help get this plugin : https://www.roblox.com/library/997404854/Catalog-Loader? and type 1001541309 in the blue box there is a ui is like a page turns the frame named 1 to framed named two
Make sure there is a thing called CreateTerritoryGui (script.Parent.Parent.Parent.CreateTerritoryGui)