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)
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)