names = {"Daniel","Jaiden","Hugh","Andrew","Lachlan","Connor"}
-----------------------------
-- Teleport players to map --
-----------------------------
local spawn = mapChosenClone.Spawn
for i,v in pairs(game.Players:GetPlayers()) do
name = v.Name
check = game.Workspace:FindFirstChild(name)
if check then
checkHumanoid = check:FindFirstChild("Humanoid")
if checkHumanoid then
local distance = math.random(-4, 4);
check:MoveTo(spawn.Position + Vector3.new(distance, distance, distance))
end
end
end
----------------------------
-- Gives names to players --
----------------------------
function handout()
for i,v in pairs(game.Players:GetChildren()) do
if workspace:FindFirstChild(v.Name) then
c = BrickColor.Random()
local b = Instance.new("BillboardGui",workspace[v.Name].Head)
b.Size =UDim2.new(6,0,2,0)
b.StudsOffset = Vector3.new(0,1.5,0)
text = Instance.new("TextLabel",b)
text.Size = UDim2.new(1,0,1,0)
text.Text = names[math.random(1,#names)]
text.TextColor3 = c.Color
text.TextScaled = true
text.BackgroundTransparency = 1
text.TextStrokeTransparency = 0
for t,k in pairs(workspace[v.Name]:GetChildren()) do
if k:IsA("Part") and k.Name ~= "HumanoidRootPart" then
if k.Name == "Torso" then
k.BrickColor = c
else
k.BrickColor = BrickColor.new("Medium stone grey")
end
elseif k:IsA("Shirt") or k:IsA("Pants") then
k:Destroy()
elseif k:IsA("Hat") then
if k:FindFirstChild("Handle") then
k.Handle:Destroy()
end
elseif k:IsA("CharacterMesh") then
k:Destroy()
end
end
for i = 10, 1, -1 do
maintext.Value = "Game begins in: " .. i
wait(1)
maintext.Value = "Game begininng"
end
text:Destroy()
end
end
end
handout()
Ok so what this does is pick everyone with a dif name, but, after the wait(10) it only destroys the text for 1 player, and not all players. Why is this. I have tried game.Players.GetPlayers() then destory text, but still nothing. Any ideas?
