Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make the model "teleport" and rotate to another object?

Asked by 2 years ago

My "museum" seems too boring so I decided to make the exhibits different on each server.

I put the exhibits into the "expo" folder or something and added Random1, which is the object where the showcase is to be located.

Almost everything in the script below works, but still the model is not in place Random1 and rotated like random 1.

Does anyone know how i can fix this?

local serverstorage = game:GetService("ServerStorage") -- here is folder with models
local folder = serverstorage.LongExpo:GetChildren() -- this is models in folder
local selecteditem = folder[math.random(1, #folder)] --this in random model in this folder


selecteditem.Parent = game.Workspace.Random1 -- model is now in workspace
selecteditem.Position = script.Parent.Position -- this doesn't work
selecteditem.Orientation = script.Parent.Position -- this don't work too
0
Models don't have a Position or Orientation property, despite having similar properties on the Properties window. You can use the SetPivot() function of models. Try "selecteditem:SetPivot(game.Workspace.Random1)". Y_VRN 246 — 2y

Answer this question