i want it so if you say cake, a part that was following you the whole time become visible and unanchored?

my script doesn't seem to work..

local Prefix = "."
local head = script.Parent:WaitForChild("Head")





if msg:lower() == Prefix .. "cake" then
   head.Anchored = false
   head.Transparency = 0

   

script.Parent.Touched:connect(onTouched)
    local h = part.Parent:findFirstChild("Humanoid") 
    if h then
        h.Health = h.MaxHealth

            wait(2)
             game.Workspace.Cake:Destroy()
end
    end
end)

  end
 end)
end

2 comments

0

which part of it does not work? The cake destroying? Also is there any errors you can check this by pressing f9

0

the whole script doesnt even work