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

Hi How Do I Make A Brick Change It Color Once To Green And Back When Touched Only Once?

How do i make a brick change its color when I touch it to any color I want then for about 1 second it changes back to its original color Only Once Not All the time

1 answer

✓ Accepted answer
partbeforecolor = script.Parent.Color3
debounce = false

script.Parent.Touched:Connect(function()
	if debounce == false then -- cooldown for spam
	debounce = true
	script.Parent.BrickColor = BrickColor:Green()
	wait(1)
	script.Parent.Color3 = Color3.new(partbeforecolor)
	debounce = false
	end
end) 

3 comments

0

so i only need to but this as a local script or a just a normal script?

0

any

0

local script only u see like minecraft ender chest but script is minecraft chest only

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