Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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.

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... Torren_Mr 334 — 4y
0
ok thx rupertrosse 39 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

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

Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
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

Answer this question