So I want myself and everyone else know how could you access DataStores without being inside of the game?
Example #1: If I wanted to change a players Stats but not inside the game itself.
Example #2: Unbanning a player without them having to join the game.
Example #3: Completely reset a players stats without them being in the game.
ect…
This is my current DataStore2:
local bannedds = require(game.ReplicatedStorage.MainModule)
game.Players.PlayerAdded:Connect(function(player)
if player.UserId ~= 996906122 then
local bdtable = {
databan1 = bannedds("BannedCheck1", player);
databan2 = bannedds("BannedCheck2", player);
databan3 = bannedds("BannedCheck3", player);
databan4 = bannedds("BannedCheck4", player);
databanreason = bannedds("ReasonOfBan", player)
}
local plrfold = game.ReplicatedStorage:WaitForChild(player.UserId)
local banfold = Instance.new("Folder", plrfold)
banfold.Name = "BanFolder"
--//Create/Save Bans
local ban1 = Instance.new("BoolValue", banfold)
ban1.Name = "BannedCheck1"
local ban2 = Instance.new("BoolValue", banfold)
ban2.Name = "BannedCheck2"
local ban3 = Instance.new("BoolValue", banfold)
ban3.Name = "BannedCheck3"
local ban4 = Instance.new("BoolValue", banfold)
ban4.Name = "BannedCheck4"
local banreason = Instance.new("StringValue", banfold)
banreason.Name = "ReasonOfBan"
local function SaveBan(UpdateBan)
ban1.Value = bdtable.databan1:Get(UpdateBan)
ban2.Value = bdtable.databan2:Get(UpdateBan)
ban3.Value = bdtable.databan3:Get(UpdateBan)
ban4.Value = bdtable.databan4:Get(UpdateBan)
banreason.Value = bdtable.databanreason:Get(UpdateBan)
end
bdtable.databan1:OnUpdate(SaveBan)
bdtable.databan2:OnUpdate(SaveBan)
bdtable.databan3:OnUpdate(SaveBan)
bdtable.databan4:OnUpdate(SaveBan)
bdtable.databanreason:OnUpdate(SaveBan)
local banplayertable = {}
table.insert(banplayertable, ban1)
table.insert(banplayertable, ban2)
table.insert(banplayertable, ban3)
table.insert(banplayertable, ban4)
for i,banbool in pairs(banplayertable) do
if banbool.Value ~= false then
player:Kick("You have been permanently banned! Reason: "..banreason.Value)
end
end
end
end)
An explanation and little example would be amazing thanks!
You are using datastore2. DataStore2 is player-based, which means you need a player instance in order to read/write to data. Just use regular data stores.
You can actually go inside Roblox Studio and use @Crazyman32’s DataStore Editor to change any Player’s Data without having to be In-Game to do it. It’s so simple and easy to use!
Its located here:
He has also made a tutorial on how to use it (Which is located in the description of the Plugin).
(Personally, it’s a lovely Plugin. Dont regret buying it at all )
I just got the plugin and watching the tutorial but I guess I’m just too new to Datastores… I used the sample save data from Roblox so I don’t even know the name and scope of my data. I am reading/writing/saving data properly from within my game, but I just don’t know the name of the database itself since I copy pasted from the Roblox sample here: Documentation - Roblox Creator Hub
So you can setup a server, have it host something like json, have a js script change the content of the json file, and in roblox you can check the json file, this is an easy way I would use other things but for you, I’d recommend this. Not really efficient but works.
Sorry for bringing this back, the only plausible way I’ve found is to use google sheets as a external datastore, seeing that this one didn’t have a solution yet, I posted here.
Anyways there are a few resources on devforum for using Google Sheets as a datastore and should solve all your problems!