Hey, im currently trying to make one of those random elevator systems, i made a script but when i tried it , the random places werent being teleported infront of the elevator, here is the script:
local door = game.Workspace.door
local pl = game.Workspace.plates
local blue = pl.blue.blue
local brown = pl.b.brown
local red = pl.red.red
local g = pl.g.green
while true do
wait(2.5)
door.Transparency = 1
door.CanCollide = false
wait(2.5)
door.Transparency = 0
door.CanCollide = false
end
while true do
local randomplate = math.random(1, 4)
local newPosition = Vector3.new(50.031, 41.296, -2.112)
if randomplate == 1 then
blue.Position = newPosition
blue.Parent.Position = newPosition
elseif randomplate == 2 then
g.Position = newPosition
g.Parent.Position = newPosition
elseif randomplate == 3 then
red.Position = newPosition
red.Parent.Position = newPosition
elseif randomplate == 4 then
brown.Position = newPosition
brown.Parent.Position = newPosition
end
wait(5)
brown.Position = Vector3.new(50.93, 0.5, -67.946)
red.Position = Vector3.new(50.93, 0.5, -67.946)
g.Position = Vector3.new(50.93, 0.5, -67.946)
blue.Position = Vector3.new(50.93, 0.5, -67.946)
brown.Parent.Position = Vector3.new(50.93, 0.5, -67.946)
red.Parent.Position = Vector3.new(50.93, 0.5, -67.946)
g.Parent.Position = Vector3.new(50.93, 0.5, -67.946)
blue.Parent.Position = Vector3.new(50.93, 0.5, -67.946)
end