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

Trying to make a "Meat processing machine". What's the issue here?

Excuse the silly commentary, but I'm hoping it'll help you figure out what exactly it is I'm trying to do. I'm working on the same game I was 4 years ago, "Eaten by Cats", and I need a brick to change color when it touches the parent of this script but it refuses. The script doesn't seem to be throwing any errors of any kind, even when I enable debug.

function onTouched(Meat) 						--Eww, something touched me!! I'm gonna call it "Meat".
	local oldmesh = Meat:FindFirstChild("Mesh")	--Was it something with a Mesh?
		if oldmesh ~= nil then					--WAS IT???
			oldmesh:Remove()					--EWW IT'S LUMPY REMOVE THE MESH
		end
	local Decal = Meat:FindFirstChild("Decal")	--Is there a Decal here?
	if Decal ~= nil then					--Just in case there is...
	Decal:Remove()							--KILL IT.
	local Decal = Meat:FindFirstChild("Decal")	--Is there a Decal here?
	end	
	
	local Humanoid = Meat.Parent:FindFirstChild("Humanoid")
	if Humanoid ~= nil then
		Humanoid.Health = 0
	end
	if Meat.Name ~= "Head" then 				--AAH, A HEAD!!
		Meat.Name = "Food2"						--I shall throw it away, and feed the rest of the body to my children.
	end
	Meat.Material = "Granite" 					--Granite looks a bit like meat, why not?
	Meat.Cancollide = true						--Arms won't fall through the ground.
	Meat.BrickColor = Color3.fromRGB(255,148,148) 		--Medium rare mutton color.
end 
script.Parent.Touched:connect(onTouched)		--This tells onTouched() to happen when it's touched.

--Script by SethPaw

1 answer

On line 20, its CanCollide, not Cancollide!

6 comments

0

Thank you! I still need help with the colors, though.

0

Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here

0

Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here

0

Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here

0

Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here

0

what the heck why are there 4 of my comments

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