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

Alright, What is wrong with this script?

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

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.

1 comment

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.

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