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

Alright, What is wrong with this script?

Asked by
IcyEvil 260 Moderation Voter
9 years ago

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)

1 answer

Log in to vote
0
Answered by 9 years ago

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.

0
Well I just wanted its Top part to close, and I want the Position of the player to be in its mouth, and also local sammich = script.Parent is the sandwich bread which the script is in. IcyEvil 260 — 9y
Ad

Answer this question