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

What is wrong with this simple script?

Asked by 10 years ago

Its inside a button...

function onHit(hit)
    if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
        Workspace.Zombie.CFrame = Workspace.Zombie.CFrame + Vector3.new(0.35,0,0)

end
end
script.Parent.Touched:connect(onHit)

1
Make sure that 'enabled' is defined, and also "CFrame" is not a property of "Model", so if "Zombie" is a model (not a "Part") then you can't set the CFrame of it. duckwit 1404 — 10y
0
what can I use instead of Zombie.CFrame to move the entire model Shaydesilva 85 — 10y

1 answer

Log in to vote
3
Answered by
aews5 15
10 years ago

Use the :MoveTo(Vector3.new(0,0,0)) function

Ad

Answer this question