Someone helped me on my last main problem for my script, but his answer for my second problem didn't work.
local minigames = game.Lighting.Minigames:GetChildren()
local GuiStatus = game.StarterGui.StatusBar.Main.Status
function updateGui(text)
GuiStatus.Text = text
for i,v in ipairs(game.Players:GetPlayers()) do
pcall(function()
v.PlayerGui.StatusBar.Main.Status.Text = text
end)
end
end
while true do
if game.Players.NumPlayers > 1 then
updateGui("Deciding What Game To Play...")
wait(3)
rangame = math.random(1, #minigames)
gamechosen = minigames[rangame]
updateGui("Game Chosen!")
wait(2)
updateGui(("We Are Playing:" ..gamechosen.Name))
wait(3)
gamechosenclone = gamechosen:Clone()
gamechosenclone.Parent = Workspace
wait(3)
local spawns = gamechosenclone.spawns:GetChildren()
for i,v in pairs(game.Players:GetPlayers()) do
local name = v.Name
local check = game.Workspace:FindFirstChild(name)
if check then
local checkhumanoid = check:FindFirstChild("Humanoid")
if checkhumanoid then
check:MoveTo(spawns[i])
end
end
end
for i = 3, 1, -1 do
updateGui(("Game Begins In:" ..i))
wait(1)
end
for i = 10, 1, -1 do
updateGui(("Time Left:" ..i))
end
updateGui("The Game Has Finished!")
gamechosenclone:Destroy()
else
updateGui("One Player Is Not Enough!")
end
wait(1)
end
This script controls a Gui, some minigames, and the spawning into the minigame. The problem is, it is not spawning me into my minigame when I want it to. It says "Unable to cast instance to Vector3" I double checked to make sure there is nothing called "name" in the Workspace.
