Datastore2 With Clans

Is there any way to use datastore2 to save data without the player being a key? Whenever I try I get this

Will I need to use classic datastore for this?

Hi Nukinq,

I was wondering if you could elaborate a lil more on what you were doing, and show the script down below so it’s more understandable?

Thanks again

Sure. I am currently trying to save clans/crews to a datastore2 key. I am just testing out and here is the code
image.
My goal is to save the data as a string (crew name/HttpServiceGUID)

I’ve been looking around some sources, and I have came up with a script that might be helpful.

local DataStore2 = require(1936396537)
local value = 900


game.Players.PlayerAdded:Connect(function(player)
	local ClanDataStore = DataStore2("ClanDataStore",player)
	
	ClanDataStore:Set(value) -- Sets the value of an object to another value, in this case 900. It can be changed to a string
	
	ClanDataStore:Save() -- Saves the value, ClanDataStore
	
	print(ClanDataStore) -- Prints an array of contents
	
	
end)

Sorry, I don’t think that’ll work. I am trying to save data not to the player because the clans will be updated. Here is an example.

Scenario 1 -
The data is one table save under the key - “MyClanName/ db454790-7563-44ed-ab4b-397ff5df737b”

The table looks like this -

ClanData = {
   ["Player1"] = "Leader"
   ["Player2"] = "Member"
}

Now if the leader wants to kick out the member it will just update the table to look like -

ClanData = {
   ["Player1"] = "Leader"
}

Scenario 2 -
Each player has data saved under their name
Player1’s key looks like - “UserID/MyClanName/ db454790-7563-44ed-ab4b-397ff5df737b”
Player2’s key looks like - “UserID/MyClanName/ db454790-7563-44ed-ab4b-397ff5df737b”

If Player2 wants to join Player1’s clan, it will have to update both of their datastores and Player1 might be offline. Now, lets say the clan has 50 members. If the leader decides to make some changes and promotes a few people, demotes a few, kicks a few, and invites some new players, then it will have to update for ALL members offline or not. I just don’t think this way is possible with the limit or very efficient. In addition, if the leader wanted to delete the clan it would be a hard process to fix for all members.