Log in to vote

I am having a problem with teleporting a tool with coordinates?

Asked by 2 months ago
Edited 2 months ago

I'm trying to make it so when you touch this button, the tool clones itself and teleports to these coordinates (-98.839, -111.395, -59.275) but I can't figure it out. My script:

game.Workspace.spawnbutton.Transparency = 0 local clone = game.Workspace.RoomKey:Clone() local KEYDOOR = game.Workspace.RoomKey script.Parent.Touched:Connect(function() game.Workspace.spawnbutton.Transparency = 1 clone.Parent = workspace clone:SetPrimaryPartCFrame(, 3.819, 252.988)) wait (3) game.Workspace.spawnbutton.Transparency = 0 --script.Parent.ClickDetector.MouseClick:Connect((onclick)) end)
The tool doesn't have the ':SetPrimaryPartCFrame' function; only 'Models' do. Try teleporting the tool's handle. DiamondComplex 270 — 2mo

1 answer

Log in to vote
Answered by 2 months ago

Your defining CFrame incorrectly. CFrame contains both position and orientation. ex.

local CFrame =, orientation) 

In addition when defining information like position you need to do so as a Vector3, which are their own data type. ex.

Part.Position =,15,20)

In your case, I would suggest editing the position of the tool rather than its CFrame, this is just cause personally I'm not too experienced and I don't understand some of the more nuanced functions of CFrame. But if your dead set on using CFrame I would suggest looking online for some more on how to use CFrame such as:

AlvinBlox CFrame Video -

Roblox Dev site -

DevKing CFrame Video -

Let me know if my explanation makes sense, or if you need some clarification.


Answer this question