Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is wrong with this simple script?

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)

2 comments

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.

0

what can I use instead of Zombie.CFrame to move the entire model

1 answer

✓ Accepted answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.