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

Can you help me fix my teleport script?

Here is my teleporting script and I cannot figure out why nothing is happening, there is no output reading.

--Made by wattleman

local sp = script.Parent
local tpm = sp.Parent.Parent.Parent:WaitForChild("tp")
local tp2 = tpm:WaitForChild("tp2")
local pos = tp2.Position

debounce = true
function m2(hit)
	if debounce then
		debounce = false
		if hit.Parent then
			local c = hit.Parent:FindFirstChild("Humaniod")
			if c then
				c:MoveTo(pos)
			end
		end
	end
	debounce = true
end

sp.Touched:connect(m2)

2 answers

This is a hierarchy mistake, note your descendants.

If sp is script.Parent, you should search for sp.Parent.Parent

12 comments

0

I am confused at what you mean.

0

Erm... answer me this: is "tp" and "tp2" a descendant of script.Parent.Parent?

0

Ahh okay! It looks like you need to search script.Parent.Parent.Parent in this case!

0

Do be aware, all of that is in one model. http://gyazo.com/55bbb65929237a561e92334b99c9258c

0

Thanks for the negative reputation... just trying to help.

0

I edited my script and it still isn't working. (Check original question, it was edited)

0

By the way, I didn't give you a negative reputation, maybe that was on a different question that you answered? Shows 0 for you on this question.

0

(Answer is edited and correct)

0

Still doesn't TP.

0

Make sure local tpm = sp.Parent.Parent:WaitForChild("tp")

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