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

Teleport Tool To Position?

Hello,

If i want to make a script that will teleport a tool from someones Backpack to a speciall position in the workspace. How do i make that?

2 comments

0

Find a way to get to the player's backpack then change the tool's parent to Workspace then set the tool's position to the position you would like it to be.

1 answer

  1. You can either clone the tool or just remove it from the backpack, note: if the tool is equipped it is NOT IN BACKPACK BUT IN PLAYERS CHARACTER!

  2. To teleport a tool you need to set the CFrame of the handle, not the tool

  3. You could fix problem one either by checking if it's in player or char or putting the script inside the tool, I'll do the last one in this example

-- Serverscript

local tool = script.Parent
used = false

while wait() do
	if used == true then
		tool.Parent = workspace
		local handle = tool:FindForChild('Handle')
		handle.CFrame = CFrame.new(Vector3.new(0,0,0))
	end
end

I do not set used to true as I don't know when you want to do the action, remember that it needs a Handle to work!

If you want to* teleport it to another part* use this

-- Serverscript

local tool = script.Parent
used = false

local part = workspace.TeleportPart -- Set this to the part

while wait() do
	if used == true then
		tool.Parent = workspace
		local handle = tool:FindForChild('Handle')
		handle.CFrame = part.CFrame
	end
end

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