So I was having trouble scripting this script:
script.Parent.Touched:Connect(function() script.Parent.Color = Color3.new(255/255,0/255,0/255)
And then I wanted to make it to where it would undo it I tried this script:
script.Parent.Touched:Connect(function() script.Parent.Color = Color3.new(255/255,0/255,0/255) wait(0.1) undo end)
And then I realized undo is not a global known word in lua Anyone know what it is?
What you need is a previous value
local prevColor = script.Parent.Color local newColor = Color3.new(255/255,0/255,0/255) script.Parent.Touched:Connect(function() script.Parent.Color = newColor wait(0.1) script.Parent.Color = prevColor end)
try that.. It changes the new color to the previous color..