Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a script reset once a brick isn't being touched?

I have this but how would I make it so once the player isn't touching the brick I could make it reset back to its original color?

function onTouched(hit)
	script.Parent.BrickColor = BrickColor.new("Really red")
end

script.Parent.Touched:connect(onTouched)

1 comment

0

What function would I have to use?

1 answer

✓ Accepted answer

This question is so easy to answer that it's TOUCHING my heart.

###1/10 for that pun.###

The TouchEnded event fires when, obviously stop touching a Part

So we can use that to make it return to it's original colour.

part.Touched:connect(function(hit)
	part.BrickColor = BrickColor.new("Colour")
end)
part.TouchEnded:connect(function(hit)
	part.BrickColor = BrickColor.new("Colour")
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.