Hi!
This is my table code.
local available = 0
local ID = 0
local maps = {
["1"] = {
["Name"] = "Toxic Town",
["Thumbnail"] = "rbxassetid://8950721768",
["PlaceID"] = "8950403502",
}
}
function Refresh()
available = 1
end
local function NewRound()
Refresh()
local Map = math.random(1, available)
print(Map)
script.Parent.title.Text = maps[Map]["Name"]
script.Parent.Thumbnail.Image = maps[Map]["Thumbnail"]
ID = maps[Map]["PlaceID"]
end
while task.wait(15) do
NewRound()
end
game.Workspace.Elevator1aTPPart.Touched:Connect(function(a)
local partParent = a.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
game:GetService("TeleportService"):TeleportAsync(ID, game.Players[humanoid.Parent.Name])
end
end)
local available = 0
local ID = 0
local maps = {
["1"] = {
["Name"] = "Toxic Town",
["Thumbnail"] = "rbxassetid://8950721768",
["PlaceID"] = "8950403502",
}
}
function Refresh()
available = 1
end
local function NewRound()
Refresh()
local Map = math.random(1, available)
print(Map)
script.Parent.title.Text = maps[Map]["Name"]
script.Parent.Thumbnail.Image = maps[Map]["Thumbnail"]
ID = maps[Map]["PlaceID"]
end
while task.wait(15) do
NewRound()
end
game.Workspace.Elevator1aTPPart.Touched:Connect(function(a)
local partParent = a.Parent
local humanoid = partParent:FindFirstChildWhichIsA("Humanoid")
if humanoid then
game:GetService("TeleportService"):TeleportAsync(ID, game.Players[humanoid.Parent.Name])
end
end)
But, itβs not reading off of the table right. I got an error trying to set the name with maps[Map][βNameβ], but this should work.
Thanks for any help!