ProfileService Breaking

Ive been using profile service for my project and i’ve enabled team create because im working with someone. But profile service keeps giving me this error when I press the blue Play button (Not team test):

509: Data Store operations blocked while running on a Personal RCC to prevent possible data corruption

On team test, the player data becomes nil. Does anyone know why this is happening?

7 Likes

Have you enabled DataStore access in Studio?
Can you try accessing the DataStore in a separate script? what about accessing a different DataStore?
Have you tried using a different account or device?

1 Like

can we see your main script? also, have you enabled api settings?

1 Like

yes I have enabled datastore access

1 Like

can we see your main script? we cant really do much without knowing what you put

1 Like

What do you mean by my “main script”? Do you mean the script im using to use profile service?

1 Like

sup! i had this error before!

The error message you are encountering, “509: Data Store operations blocked while running on a Personal RCC to prevent possible data corruption,” indicates that Data Store operations are being blocked when running on a Personal RCC (Roblox Cloud Compute). This is done to prevent potential data corruption.

To resolve this issue, you can try a few troubleshooting steps:

  1. Ensure that you and your collaborator are both using the latest version of Roblox Studio and have the necessary permissions to access and modify Data Store data.
  2. Make sure that you are not running any conflicting scripts or plugins that may be interfering with the Data Store operations.
  3. Check if the issue persists when running the game outside of Team Create mode. If it only occurs in Team Create, it might be worth contacting Roblox Support for further assistance.
  4. Verify that the Data Store service is functioning correctly by checking the Roblox Developer Hub or the Roblox Status page for any ongoing issues or maintenance.

Regarding the issue with player data becoming nil on Team Test, it’s challenging to pinpoint the exact cause without more information about your project and code. However, you can try debugging by checking if the player data is being properly initialized and saved during gameplay.

If you are unable to resolve the issue, it is recommended to seek help from the Roblox Developer Forum or contact Roblox Support for more specific guidance related to your project’s requirements.

4 Likes

If so then here it is:

local ProfileService = require(game:GetService("ServerScriptService").Essentials.ProfileService)
local Players = game:GetService("Players")

local ProfileStore = ProfileService.GetProfileStore(
	"PlayerData",
	{
		LastPosition = {X = 0, Y = 0, Z = 0},
		Inventory = {},
		Pets = {},
	}
)

local Profiles = {}

local function onPlayerAdded(player)
	local profile = ProfileStore:LoadProfileAsync("Player_"..player.UserId,"ForceLoad")
	if profile then
		profile:Reconcile()
		
		profile:ListenToRelease(function()
			Profiles[player] = nil
			player:Kick()
		end)
		
		if player:IsDescendantOf(Players) then
			Profiles[player] = profile
		else
			profile:Release()
		end
	else
		player:Kick()
	end
end

local function onPlayerRemoving(player)
	local profile = Profiles[player]
	
	if profile then
		profile:Release()
	end
end

for _, player in Players:GetPlayers() do
	task.spawn(onPlayerAdded,player)
end

Players.PlayerAdded:Connect(onPlayerAdded)
Players.PlayerRemoving:Connect(onPlayerRemoving)


local PlayerDataManager = {}

function PlayerDataManager.Get(player)
	local profile = Profiles[player]
	
	if profile then
		return profile.Data
	end
	
end

function PlayerDataManager.AddPet(player, pet, nickname, level, gender, reciveNote)
	local data = PlayerDataManager.Get(player)
	print(data)
	print(pet.Name)
	local newPet = {
		Pet = pet.Name, 
		Nickname = tostring(nickname), 
		Level = level, 
		Gender = tostring(gender),
		
		DateObtained = DateTime.now():FormatLocalTime("LL", "en_us"),
		Note = tostring(reciveNote)
	}
	
	table.insert(data.Pet, newPet)
end


return PlayerDataManager

repost

2 Likes

What are the necessary permissions? I thought I already had datastore permissions enabled. Does my collaborator also need access to those permissions?

2 Likes

try running profile:AddUserId(player.UserId) before you reconcile it

3 Likes

what does reconcile do in the first place?

2 Likes

In Roblox, the ProfileService module requires specific permissions to function properly. Here are the necessary permissions for the ProfileService module:

  1. Read/Write Access to the DataStore: The ProfileService module needs read and write access to a DataStore in order to save and load player profiles. Make sure the DataStore is properly configured and that the module has the necessary permissions to access it.

  2. Player DataStore Permissions: The player’s DataStore must have read and write permissions for the game to save and load their profile data. You can set these permissions in the Roblox DataStore service settings.

  3. Server Script Access: The ProfileService module should be placed in a server-side script to properly manage player profiles. Ensure that the script containing the ProfileService module is running on the server and has the necessary permissions to access player data.

By ensuring these permissions are correctly set up, you should be able to use the ProfileService module without any issues.

2 Likes

Fills in missing values, so if you add something to your template it’ll automatically fill in player’s missing data value when they join. This lets you update and add more values.

1 Like

Ok, and what if the player has some values I dont want them to have anymore? Like Ive made a mistake, or changed the template entirely?

1 Like

NO. in no case you need to give him the same paermissions you have.

1 Like

I don’t fully know what happens there. I’m pretty sure profileservice uses the template for data names and stuff, just remove it from the template and you should be fine.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.