uhh yes…
Hello!
i’m once again asking for your help…
so yes there is this function…well it doesn’t work (i don’t know how to explain it withouth showing it )
i guess here:
local function SpawnBorders(Pos)
local RandomBorders = math.random(1,#Borders)--Just to choose a random model
for i,v in pairs(Borders) do--Table of bordermodels
if i == RandomBorders then
if v:IsA("Model") then
local Clone = v:Clone()
Clone.Parent = workspace
Clone:PivotTo(CFrame.new(Pos))
print(Clone.WorldPivot)--Prints vector3
end
end
end
table.insert(UsedPositions,Pos)--Inserts vector3
print(UsedPositions.Pos)--Nil?
end
now this function is VERY Important, not only places it down the borders, but it also inserts their position into the usedposition table so that other scripts know not to spawn any other stuff there!
when i went to run this code, it uhh kept placing borders in the same spot… because when i went to check in the table, it never inserted the position apparently?
i even tried instead of the argument inserting the actual world pivot of the model… didn’t do anything.
how do i solve this?
oh! almost forgor here is the script that checks positions and returns true if they are occupied!
local function CheckIfOccupied(Pos)
for i,v in pairs(UsedPositions) do
if v == Position then
return true
end
end
end
thanks in advance!