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

How to make Models or Tools Teleport?

Im trying to make the phantom forces thing where the weapon shows up when you click a textbutton. I have tried everything and nothing works. Here are all the scripts I have made that dont work.

function onClicked()
game.Workspace.IMR = Vector3.new(-159.9, 16.8, -77.8)
end
script.Parent.MouseButton1Down:connect(onClicked)

function onClicked()
game.Workspace.IMR.CFrame = CFrame.new(-159.9, 16.8, -77.8)
end
script.Parent.MouseButton1Down:connect(onClicked)

function onClicked()
game.Workspace.Model = Vector3.new(-159.9, 16.8, -77.8)
end
script.Parent.MouseButton1Down:connect(onClicked)

function onClicked()
game.Workspace.Model.CFrame = CFrame.new(-159.9, 16.8, -77.8)
end
script.Parent.MouseButton1Down:connect(onClicked)

1 answer

Models have a property called "PrimaryPart". You choose one part from the model to be the PrimaryPart, and when you move the PrimaryPart, every other part of the model moves in relation to it. You have to move the model using SetPrimaryPartCFrame (or MoveTo, but this doesn't teleport the model).

game.Workspace.Model.PrimaryPart = "insert part here"
function onClicked()
	game.Workspace.Model:SetPrimaryPartCFrame(CFrame.new(-159.9, 16.8, -77.8))
end
script.Parent.MouseButton1Down:connect(onClicked)

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