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?
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?
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!
To teleport a tool you need to set the CFrame of the handle, not the tool
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.
2 comments
Read up on CFrames. https://devforum.roblox.com/t/how-to-think-about-cframes/11743
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.