✓ Accepted answer
First of all I would suggest using code blocks in the future, as it was difficult to understand the code from the question itself and I had to format it in studio to read what you were trying to achieve (Lua button next to bold, italics, etc).
As it is a small script, I will help you out with my own code and explain how it works with comments.
The script is as follows:
function LightUp()
local debounce = false
if debounce == false then
debounce = true
script.Parent.Material = "Neon"
wait(10)
script.Parent.Material = "Plastic"
debounce = false
end
end
script.Parent.Touched:connect(LightUp)
Enjoy :-)
Next time I would recommend thinking through your issue more and having a better attempt at coding, as this was weak to begin with.
1 comment
Code block. Use. Please.