(before I start i want to let you know this is really long) I was making a game about the UTG (ultimate trolling gui). It is basically a testing zone that will let you do any command from the GUI. But when I click on the "R6" button (makes your character r6 so it can load the utg) a little button pops up at the top and it says "Original Game". I can't find where it comes from as it is not in the r6 script and I can't find it in the GUI itself. I did some research and looked at a plugin that was required in the r6 script but it was just a script that combined the joints and made your character r6. When you clicked on the Original Game button it would teleport you to another game. I made a script that was supposed to remove it whenever it pops up, but i'm having a problem. The script says
playerGui.Rejoin:Remove() --playerGUI is a variable i made and Rejoin is the name of the GUI that keeps bugging me
but it isn't working. I think a script that checks if the "Rejoin" button exists and removes it if it does would work, but I don't know how to check if an item exists. Here is the original script:
local playerGui = script.Parent.Parent playerGui.Rejoin:Remove()
(sorry for the long the backstory, and i dont know how to describe the thing that should be removed)
You could try this:
local playerGui = script.Parent.Parent local playerGuiParent = playerGui.Parent local originalgame = playerGuiParent:FindFirstChild("[change-to-name]") -- the name of the "original game" gui also finds the first child of this name if originalgame then print("It exists!") originalgame:Destroy() print("now it doesn't :D") return -- just so it doesn't go to the other one end else print("It doesn't exist!") end