✓ Accepted answer
Okay you should also post the error message but I can see what is wrong.
And not entirely sure what you want but here is some code.
And there is couple of things i see wrong read my explanation I added better code to my understading.
Code is tested in studio.
local player = game.Players:GetPlayers()
game.Players.PlayerAdded:Connect(function(player)
local Live = Instance.new("NumberValue")
Live.Name = player.Name
Live.Parent = game.ServerStorage.Lives
Live.Value = 7
end)
while true do
wait(0.1)
local player = game.Players:GetPlayers()
for i = 1,#player do
if #player <= 0 then
print "No players present."
elseif #player >= 1 then
print "Enough players present."
print "Game Starting..."
wait(60)
end
end
end
Note I think there is a better approach to the while loop
So the game.Players.PlayerAdded is event that fire everytime a player connects and the at that point it adds the live .And make sure you have file named Lives inside game.ServerStorage.
Then in the while loop.So game.Players:GetPlayers() return table with all players inside learn about tables if you don't know it now i added a for loop and the # sign before player give the the amount in table as number so example if you have table local tab = {"bobby","John","Sally"} and you do this print(#tab) it will print 3 since there are 3 stuff in the table now inside the for loop the wait is for the match time before the game ends after the while loops starts over. Reply if you have more questions.
2 comments
Thank you, this worked.
Cool let me if you have any questions.