Basically, I'm making a GUI with a button, when you click it, it checks if there is a RemoteEvent present, which if it does, it works, but the else statement doesn't seem to work.
script.Parent.MouseButton1Click:Connect(function()
if game.ReplicatedStorage.gui_instance ~= nil then
game.ReplicatedStorage.gui_instance:FireServer()
script.Parent.Parent.Parent.Frame.Visible = true
script.Parent.Parent.Parent.Frame1:Remove()
game.StarterGui:SetCore("SendNotification",{Title="Success!"; Text="GUI Attached!"})
else
game.StarterGui:SetCore("SendNotification",{Title="Error"; Text="RemoteEvent not found!"})
wait(10)
script.Parent.Parent.Parent.Parent.ScreenGui:Remove()
end
end)

9 comments
What is your goal, if you don't mind me asking?
I'm mainly testing a GUI, and the script Conditions?
For a GUI?
pretty much lol
Loading a House??
:Remove() is deprecated, use :Destroy() instead
It's really not need tho, Remove works just the same and has not defects. They just replaced it with a fancy work. Destroy.
Wrong, :Destroy() locks the parent property while :Remove() does not. Don't use deprecated code, period.
Try using FindFirstChild or WaitForChild instead of using if object ~= nil