How come when I test my game its never deletes the screen GUI even tho it says to do so what when wrong?
---|Script|---
local a = Color3.fromRGB(255,255,255)
local b = Color3.fromRGB(12,53,0)
local Camera = workspace.CurrentCamera
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Name
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.Carthaginians.TextColor3 == b then
script.Parent.TextColor3 = b
if script.Parent.TextColor3 == b then
wait(1)
Camera.CameraType = Enum.CameraType.Custom
end
game.Players.LocalPlayer.TeamColor = BrickColor.new("Earth green")
game.Workspace.Character.Humanoid.Health = "0"
script.Parent.Parent.Parent:Destroy()
end
end)
---|Locations|---
The local script is located in a button called Select and the button's parent is a frame then the frame's parent is the screen GUI.

1 comment
try script.Parent.Parent.Parent."name of what you wanna destroy":Destroy() . you must gain the appropriate reference to the object you want to destroy other wise it wont work