The thing is that I am making a database of players for my group, and I want to add a notification if a player is in the group (there is a search bar, then I click load and it load the information from Data Storage) I also would like to know how to get information from a player (MembershipType and AccountAge)
The solution I found is to create a Player, then set it's ID with a script (2nd Question) But this solution is imposible, because you cannor create an instance player.
to get info on a player while the are offline you need datastores. period. Essentially, you need to use a few stores with the key unique per player (player.userId, NOT their name).
ds = game:GetService("DataStoreService") rank = ds:GetDataStore("Rank") GroupID = 1337 game.Players.PlayerAdded:connect(function(player) rank:UpdateAsync(player.userId,function(old) return old or 1 end) local int = Instance.new("IntValue",player) int.Name = "Rank" if player:IsInGroup(GroupID) then local real = player:GetRankInGroup(GroupID) int.Value = real else int.Value = 1 end end)
also, make sure that it saves their stats when they leave
game.Players.PlayerRemoving:connect(function(player) rank:SetAsync(player.userId,player:WaitForChild("Rank").Value) end)
Its been a while since I've done group stuff, so the GetRankInGroup and IsInGroup are probably wrong, but that is a quick switchout with whatever is on the object browser and/or wiki. The logic still stands, however, and you can add more info like account age and other misc. stuff.