What I would like to achieve is that my game is supposed to load up plates like Plates of Fate and give them out to every player in the game. My issue is that every first round it works completely fine and then the next rounds it dosent. I Have no idea what im doing wrong?? I tried to change my system a little up and trying to find it. but I cant find anything thats affecting it.
for i,v in pairs(Players) do
local num = math.random(1,#availablePlates)
local chosen = availablePlates[num]
local plateValue = Instance.new("ObjectValue",v) -- This is the value which i get the players assigned plate.
plateValue.Name = "Plate"
plateValue.Value = plates:FindFirstChild(chosen.Name) -- Somehow it changes to a diffrent plate when its assigned to the same Plate
v.Character.HumanoidRootPart.Position = plateValue.Value.Position + offset
table.remove(availablePlates,num)
end
for _, player in pairs(Players) do
local found = table.find(availablePlates,player)
if found then
table.remove(availablePlates,found)
end
end
for i,v in pairs(availablePlates) do
v.Transparency = 1
v.CanCollide = false
end