Editing Profile Service!

So I’ve got a profile service data store for my game, and I saved all the banned people on there, is there any way i could make it so i can edit the data inside a profile? when they are not online

local Banned = {
	"name",
	"name",
	"name",
	"name",
	"name"
}

game.Players.PlayerAdded:Connect(function(player)
	for i,v in pairs(Banned) do
		if player.Name == v then
			player:Kick("You are banned")
		end
	end
end)

Can make it this way

2 Likes

I recommend this plugin:

to edit your datastore.

So I need to edit the ‘Banned’ value remotely from studio, I tried using DataStore Editor but I cant seem to figure out what the profile service datastore is called so i can edit it… this is a bit of my profile service code…


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

local ProfileStats = {
	Time = 0,
	BestTime = 0,
	Kills = 0,
	Deaths = 0,
	Streaks = 0,
	LastLogIn = 0,
	PvpTag = false,
	Banned = false,
}


local ProfileStore = ProfileService.GetProfileStore(
	'Player',
	ProfileStats
)

local Profiles = {}

local function LoadData(Player, Profile)
	local Leaderstats = Player.leaderstats

			local Profile = Profiles[Player]

			if Profile then		
		Leaderstats.Time.Value = Profile.Data.Time
		Leaderstats.BestTime.Value = Profile.Data.BestTime
		Leaderstats.Deaths.Value = Profile.Data.Deaths
		Leaderstats.Kills.Value = Profile.Data.Kills
		Leaderstats.Pvp.Value = Profile.Data.PvpTag
		Player.Banned.Value = Profile.Data.Banned
	end
	if Profile.Data.PvpTag == true then
		Profile.Data.Time -= 0.50 * Profile.Data.Time
		Leaderstats.Time.Value -= 0.50 * Leaderstats.Time.Value
		Profile.Data.PvpTag = false
		Leaderstats.Pvp.Value = false
	end
	if Profile.Data.Banned == true then
		Player:Kick('You are banned!')
	end
end

yeah i saw what you did, but im not trying to ban them. I’m trying to unban then by removing their ‘Banned’ value to false

That does not have to do with anything. They are asking how they would change the ban value of a player remotely, without them joining the game. You’ve provided a script that kicks a player if they are in a table.

I am also using ProfileService to manage my banlist.

  1. The name portion should be the name of your datastore.
    mine is “PlayerData” yours is “Player”.

  2. You can leave the scope blank

  3. The key would be whatever you put for your loadprofileasync. Mine is “Player_UserId”

2 Likes

I named my load profile async to Player_UserId too


local function onPlayerAdded(player)
	local Profile = ProfileStore:LoadProfileAsync(
		"Player_" .. player.UserId,
		"ForceLoad"
	)
	


You can edit it like a normal datastore. If your profile store is called Player, then the datastore name is Player. If your key was Player_youruserid, then that’s the key in the datastore.

c

6 Likes

I would try looking for a plugin.