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

My TP Pad does not work and always gives me this error message?! Help Please!

Why does my TP Pad not work? It keeps saying "Workspace.Level1.TP LvL 1 - LvL 2.Script:8: invalid argument #1 to 'new' (Vector3 expected, got Instance) - Server - Script:8".

This is the script:

local db = false local dbwait = 5

script.Parent.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) and db == false then local Root = hit.Parent:FindFirstChild("HumanoidRootPart")

	Root.CFrame = CFrame.new(workspace.Level1["TP LvL 2 - LvL 1"])
	db = true
	wait(dbwait)
	db = false
end

end)

Thank you, Please Help.

1 answer

Try this

local tpPart = workspace:FindFirstChild("TPPart") --  The location of your teleport part
local cooldown = false

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if cooldown == false then
			cooldown = true
			
			hit.Parent:FindFirstChild("HumanoidRootPart").CFrame = tpPart.CFrame
			
			wait(3) -- Cooldown time
			
			cooldown = false
			
		end
	end
end)

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