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.