I want to make a gui that when they click a button, a car spans next to them Idk how to teleport models but I tried in the script below and of course is isn't working.
function OnClicked() for i, v in pairs(game.Workspace) do v.Car.CFrame = CFrame.new(Vector3.new(50, 50, 50)) -- Change numbers to whatever end end script.Parent.MouseButton1Down:connect(OnClicked)
First of all, you don't have anything to check to make sure that there is something called "Car" as a child to the child of workspace. Assuming that "Car" is a model, you'll need to utilize :MoveTo()
or :SetPrimaryPartCFrame().
Make sure you set the Primary Part of "Car" somehow before using the methods.
Also, you created a CFrame with an already explicit Vector3. There is really no point to that, you can just do: CFrame.new(50, 50, 50)