local playerService = game:GetService("Players") local players = playerService:GetPlayers() for _, player in pairs(players) do local int = Instance.new("IntValue") int.Name = "playersLeft" int.Value = false int.Parent = player print("playersFound") end
and my script is in serverScriptService
This simple script will go through all players and adds a bool value to each player
local playerService = game:GetService("Players") local players = playerService:GetChildren() for _, player in pairs(players) do local bool = Instance.new("BoolValue") bool.Name = "playersLeft" bool.Value = false bool.Parent = player end
you can check if the script works by going in players and see if there is a bool value called playersLeft. Hope this helps