im making a puzzle game and one of the main things is putting a part on a buton to open a door. i made a simple script that changes the button's color when you put the part on it.
script.Parent.Touched:connect(function(hit)
if hit.Name == "qb" then
script.Parent.BrickColor = BrickColor.new("Really red")
end
end)
how do i make it so that the color changes back when thepart stops standing on the button? i will change the color changing into opening doors later.

1 comment
You could use the TouchEnded event to accomplish this. See: https://create.roblox.com/docs/reference/engine/classes/BasePart#TouchEnded