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(CFrame.new(246.009, 3.819, 252.988))
wait (3)
game.Workspace.spawnbutton.Transparency = 0
--script.Parent.ClickDetector.MouseClick:Connect((onclick))
end)

1 comment
The tool doesn't have the ':SetPrimaryPartCFrame' function; only 'Models' do. Try teleporting the tool's handle.