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

Need help with color changing part?

I'm trying to make some stuff this will help a lot. thanks.

basically i need to have a script that when i go onto a part, it changes its color to red for a small amount of time, and then reverts back to its original (green) color. thank you so much.

1 answer

✓ Accepted answer
Part = script.Parent -- Change this to the brick you want affected.  This will also be the brick that fires the fucntion if touched.
Part.Touched:connect(function(Hit)
	Part.BrickColor = BrickColor.new("Bright red")
	wait(5) -- Time before changing back.
	Part.BrickColor = BrickColor.new("Bright green")
end)

This will also activate if any other brick touches it. However,

Part = script.Parent -- Change this to the brick you want affected.  This will also be the brick that fires the fucntion if touched.
Part.Touched:connect(function(Hit)
	if Hit.Parent.Humanoid ~= nil then -- Makes sure the thing that hits it is a player, or human and not a part.
	Part.BrickColor = BrickColor.new("Bright red")
	wait(5) -- Time before changing back.
	Part.BrickColor = BrickColor.new("Bright green")
	end
end)

1 comment

0

Worked perfectly :D thanks for your help!

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