can someone help me with a script that deletes a object after 5 seconds if its clicked.
How to make so if a object is clicked it gets deleted after 5 seconds?
2 answers
Okay you clearly know nothing about ROBLOX Lua, and didn't attempt to solve this yourself.
BUT HEY I feel nice today.
script.Parent.MouseMouseButton1Click:Connect(function()
wait(5)
YourObjectNameHere:Destroy()
end
put this script inside the object you want to destroy() clickdetector
1 comment
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
You Can use ClickDetectors for that. Right Click the Object you want to be deleted within 5 seconds (in the Explorer) Hover your mouse to [Insert Object] Insert an [ClickDetector] into the Object
Now insert a Script into the Object Write this Code on the Script:
local Object = script.Parent
local ClickDetector = Object:WaitForChild('ClickDetector')
ClickDetector.MouseClick:Connect(function(Player) --You won't use "Player", its optional.
ClickDetector:Destroy() --Removes the ClickDetector, so it can't be clicked Again
wait(5) --How Many Seconds before the Object gets Removed?
Object:Destroy() --Remove the Object
end)
Instead of CTRL+C and CTRL+V, Study how the Code works and experiment it!
4 comments
You realize he cant "study" this right? he clearly knows nothing about lua, or even tried to learn anything. He just wants to leach, he knows nothing at all, take code and not learn. He wont understand any of this
i'm not going to start a discussion because of an Coding Answer, i understand what you mean but i hope he can learn something even if a bit.
I actually study it to lern I'm a newbeginner
Sorry i was rude i wasn't thinking, and thats good, Good luck man
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
This is not a request site. Your question's description should almost never start with "I need."
Ok thanks BlueGrovyle for the info.