Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 3 years ago

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

Log in to vote
2
Answered by 3 years ago

On line 20, its CanCollide, not Cancollide!

0
Thank you! I still need help with the colors, though. sethpaw 2 — 3y
0
Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here Gmorcad12345 434 — 3y
0
Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here Gmorcad12345 434 — 3y
0
Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here Gmorcad12345 434 — 3y
View all comments (2 more)
0
Meat.Color = Color3.fromRGB(yourcolor), you cant use brickcolor here Gmorcad12345 434 — 3y
0
what the heck why are there 4 of my comments Gmorcad12345 434 — 3y
Ad

Answer this question