Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do I make a script delete a click detector that activated the script itself ?

here is the code I used:

game.Workspace.part.ClickDetector.MouseClick:Connect(function(player)

	print ("TESTING")
	game.Workspace.part.ClickDetector.parent = nil

end)

So far , the clickdetector is not gone after the click... no print has been made either.

2 comments

0

If no print has been made, are you sure that the ClickDetector is there? I suggest putting the script in the "part" and doing. script.Parent.ClickDetector.MouseClick:Connect...

0

ok thx

2 answers

You should try deleting it with game.Workspace.Part.ClickDetector:Destroy()

game.Workspace.part.ClickDetector.MouseClick:Connect(function(player)

	print ("TESTING")
	wait(1)
	game.Workspace.part.ClickDetector:Destroy()
end)

I did this and so far , nothing happened looks like it is impossible

This discussion is preserved as it was. New answers, comments, and votes are closed.