script.Parent.Touched:connect(function() script.Parent:Destroy(); script.Parent.Parent.Parent.StarterGui.ScreenGui.Enabled = true end)
This script is supposed to delete it's parent and enable a GUI, but it won't work,. Any help ?
You need to Enable script before deleting its parent, you will delete this script after deleting its parent and you cant enable other script man :/
script.Parent.Touched:connect(function() script.Parent.Parent.Parent.StarterGui.ScreenGui.Enabled = true --First This script.Parent:Destroy() end)
First think about your script dude. If you break down your script it's saying "When the parent is Touched, destroy the parent AND THEN enable the GUI. The fix is easy just flip em around." Just use this,
script.Parent.Touched:connect(function() script.Parent.Parent.Parent.StarterGui.ScreenGui.Enabled -- Start with this so you don't delete your GUI you want to enable script.Parent:Destroy() end)