On line 18, you're calling a function that doesn't exist
On line 4, you make a function named "onTouch". On line 18 however, you try to call a function by the name of "steppedOn", which doesn't exist.
To fix this, just rename the function or you're call. Below are the two possible fixes,
local Pad = script.Parent
local Blob = script.Parent.Parent
local function onTouch(Player)
Blob.BrickColor = Red
wait(0.5)
Blob.BrickColor = Orange
wait(0.5)
Blob.BrickColor = Yellow
wait(0.5)
Blob.BrickColor = Green
wait(0.5)
Blob.BrickColor = Toothpaste
wait(0.5)
Blob.BrickColor = Magnenta
wait(0.5)
end
Blob.Touched:connect(OnTouch)
Or
local Pad = script.Parent
local Blob = script.Parent.Parent
local function steppedOn(Player)
Blob.BrickColor = Red
wait(0.5)
Blob.BrickColor = Orange
wait(0.5)
Blob.BrickColor = Yellow
wait(0.5)
Blob.BrickColor = Green
wait(0.5)
Blob.BrickColor = Toothpaste
wait(0.5)
Blob.BrickColor = Magnenta
wait(0.5)
end
Blob.Touched:connect(steppedOn)
EDIT,
You're not changing the color right.
When changing the color of a brick, you need to use BrickColor.new()
Here's your final fixed script,
local Pad = script.Parent
local Blob = script.Parent.Parent
local function steppedOn(Player)
Blob.BrickColor = BrickColor.new("Really red")
wait(0.5)
Blob.BrickColor = BrickColor.new("Orange")
wait(0.5)
Blob.BrickColor = BrickColor.new("New yeller")
wait(0.5)
Blob.BrickColor = BrickColor.new("Camo")
wait(0.5)
Blob.BrickColor = BrickColor.new("Toothpaste")
wait(0.5)
Blob.BrickColor = BrickColor.new("Magnenta")
wait(0.5)
end
Blob.Touched:connect(steppedOn)
You may need to change the names of the colors to the weird names Roblox has given them.
That should fix the errors and make the brick change colors.
Good Luck!
2 comments
I'm going to edit my answer to fix the block not changing colors
Lol, sorry about that. If I helped you, please accept my answer, it helps a lot.