This is the script I made. Did I mess up? The randomization/Spawning in part work great. However, when I reset my character, they just go to another spawner, and not theirs.
local AvailableSpawners =
{I did game(dot)Workspace(dot)SpawnerNumber1-6) Roblox is filtering out this part.}
local TakenSpawners = {}
game.Players.PlayerAdded:Connect(function(plr)
local random = math.random(1 , #AvailableSpawners)
local spawner = AvailableSpawners[random]
table.remove(AvailableSpawners , random)
table.insert(TakenSpawners , spawner)
spawner.Owner.Value = plr.Name
plr.CharacterAdded:Connect(function(char)
char:MoveTo(spawner.Position)
end)
end)
game.Players.PlayerRemoving:Connect(function(plr)
for i , v in TakenSpawners do
if v.Owner.Value == plr.Name then
v.Owner.Value = "NoOwner"
table.remove(TakenSpawners , i)
table.insert(AvailableSpawners , v)
end
end
end)
|