sp = script.Parent

sp.ClickDetector.MouseClick:connect(function(hit)
	game.Players.LocalPlayer.PlayerGui.ObjectiveGui.Text.Value = "Objective : Go back to bed"
	game.Players.LocalPlayer.PlayerGui.ObjectiveGui.Main.Disabled = false
	wait()
	game.Workspace.CantBeAsked2:Destroy()
	wait(0.1)
	script.Parent:Destroy()
	wait(0.1)
end)

It is suppose to delete the parent but instead it does absoutley nothing, Ive tried it in a LocalScript and a normal Script, no luck. please help

4 comments

0

Local Scripts don't work in workspace and scripts can't access LocalPlayer.

0

so what do i do?

0

why do you have waits? makes no since to have wits :/

0

You could try to have it in a local script and put the local script someplace "StarterCharacterScripts." Then you could make a few changes so that the variable "sp" references the object in the workspace.