i want to remove the object that math.random takes, to only pick one for each door
example: for door1.mapArea.Value = obby1 for door2.mapArea.Value = obby3 for door3.mapArea.Value = obby2
mapArea is a objectValue
Code:
while true do
wait(1)
local doorsarray = {workspace["Teleporters"].Door1.mapArea, workspace["Teleporters"].Door2.mapArea, workspace["Teleporters"].Door3.mapArea}
local doorrandom = doorsarray[math.random(1,#doorsarray)]
local obbyarray = {workspace.obby1, workspace.obby2, workspace.obby3}
local obbyrandom = obbyarray[math.random(1,#obbyarray)]
print(obbyrandom)
doorrandom.Value = obbyrandom
local function removerandom(array, values)
for i = #array, 1, -1 do
if array[i] == values then
table.remove(array, i)
end
end
end
removerandom(obbyarray, obbyrandom)
print(#obbyarray)
end
