Im trying to make a game where a sandwich is running arounding eating people(Karma in a nutshell) However my script isn't working, can you help me out?
script.Parent.Touched:connect(function(hit) if hit.Parent then local humanoid = hit.Parent:findFirstChild("Humanoid") if humanoid then local char = hit.Parent if char then char.Torso.CFrame = script.Parent.tounge.Position char.Torso.Anchored = true if char.CFrame == script.Parent.tounge.Position then local sammich = script.Parent if sammich then sammich.topbread:MoveTo(18.3, 16.7, 7.2) sammich.Head:MoveTo(25.584, 20.562, 6.465) wait(.5) sammich.topbread:MoveTo(18.3, 15.5, 7.2) sammich.Head:MoveTo(25.584, 19.362, 6.465) wait(.5) sammich.topbread:MoveTo(18.7, 13.7, 7.2) sammich.Head:MoveTo(25.584, 18.762, 6.465) end end end end end end)
Only humanoids can use MoveTo. Throwing MoveTo on models is rather glitchy and will not make the "walking" effect but instead it will teleport. And also, what is ~~~~~~~~~~~~~~~~~ local sammich = script.Parent ~~~~~~~~~~~~~~~~~ for? Also, MoveTo uses Vector3. Not just 3 numbers.