How to make this script work?

I have been trying to make a system where there are two parts, and when you step on one of a parts it disappears after a while and you have to jump to the second part and vice versa.

But when I tried this script nothing happened:

local disappear = script.Parent

local function onPartTouch(otherPart)
	local character = otherPart.Parent
	local humanoid = character:FindFirstChildWhichIsA("Humanoid")
	if humanoid then
		disappear.Color = BrickColor.new("Really red")
		wait (0.5)
		disappear.Transparency = 1
		disappear.CanCollide = false
		wait (0.5)
		disappear.Color = BrickColor.new("Persimmon")
		disappear.Transparency = 0
		disappear.CanCollide = true
	end
end

disappear.Touched:Connect(onPartTouch)

What am I missing?
Is the code completely wrong or I just need to make an extra addition.

1 Like

the only problem i see is

disappear.Color = BrickColor.new("Really red")
and
disappear.Color = BrickColor.new("Persimmon")

a brickcolor isnt a color3 value so this wont work, you could just add a .Color to it or make it disappear.BrickColor

option 1

disappear.Color = BrickColor.new("Really red").Color

option 2

disappear.BrickColor = BrickColor.new("Persimmon")

where I got my info:

https://developer.roblox.com/api-reference/property/BasePart/BrickColor
https://developer.roblox.com/api-reference/property/BasePart/Color
https://developer.roblox.com/en-us/api-reference/datatype/BrickColor#properties