Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change brick color after player has stepped off?

Asked by
owenm00 22
4 years ago

This is what I have for my script:

script.Parent.Touched:Connect(function() script.Parent.Color = Color3.new (255/255,0/255,0/255) end)

When a player steps on it. The button turns from Green to red.

But can't figure out how to do the opposite when a player steps off to change from Red to Green.

1 answer

Log in to vote
1
Answered by
Leamir 3138 Moderation Voter Community Moderator
4 years ago

Hello, owenm00!

You can use TouchEnded for this

script.Parent.TouchEnded:Connect(function() 
    script.Parent.Color = Color3.new (255/255,0/255,0/255) 
end)
Ad

Answer this question