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

Teleport Script help?

I wrote my own script for teleporting. It doesn't work. What's wrong with it?

--Ok, so I am trying to make a teleport script.
function h(part)
	local h = part.Parent.findFirstChild("Humanoid")
	if (h ~= no) then
		h.Parent.MoveTo(Workspace.SpawnLocation.Position + Vector 3. new (0,4,0)
	end
	end
	-- I don't know where I went wrong. A little help?

3 answers

That's all wrong, this is not java! That's the fixed code:

yourPart.Touched:connect(part)
	local h = part.Parent:FindFirstChild("Humanoid")
	h.Parent:MoveTo(Workspace.SpawnLocation.Position + Vector 3. new (0,4,0))
end

1 comment

0

I edited a little bit, refresh the page

Wow sorry it should be:

function AlessIsANoob(p)
local h = p.Parent:findFirstChild("Humanoid")
if (h ~= nil) then
h.Parent:MoveTo(Workspace.PUT PART NAME HERE.Position + Vector3.new(0, 3, 0)
end
end

script.Parent.Touched:connect(AlessIsANoob) -- he needs lessons(Aless) cause i didnt do java.

1 comment

0

On LINE 4 PUT A ")" NEXT TO THE "0" (Last 0!)

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