Help with Crazymans DataStore Editor plugin

Heyo, so I have been struggling to get my first DataStore up and running using the script provided on the wiki so I decided to fire up this plugin by Crazyman so I can see what is, or isnt, in my DataStore tables. This post is specifically about the plugin, I will keep any DataStore related question for another thread/time.

SO then, the plugin does not seem to connect to my DataStore. From watching to tutorial, we can see that once you input the place idea, either manually or by default, it should give some feedback on the place, and creator. Mine does not do this, see image:

I am using the default code provided from the wiki and the name given the DataStore in that code is “PlayerData” I do believe, pasting that code again for reference, below.

Thanks for your help!

    -- Set up table to return to any script that requires this module script
local PlayerStatManager = {}
 
local DataStoreService = game:GetService("DataStoreService")
local playerData = DataStoreService:GetDataStore("PlayerData")
 
-- Table to hold player information for the current session
local sessionData = {}
 
-- Function that other scripts can call to change a player's stats
function PlayerStatManager:ChangeStat(player, statName, value)
	local playerUserId = "Player_" .. player.UserId
	if tonumber(sessionData[playerUserId][statName]) and tonumber(value) then
		sessionData[playerUserId][statName] = sessionData[playerUserId][statName] + value
	else
		sessionData[playerUserId][statName] = value
	end
end
 
-- Function to add player to the 'sessionData' table
local function setupPlayerData(player)
	local playerUserId = "Player_" .. player.UserId
	local success, data = pcall(function()
		return playerData:GetAsync(playerUserId)
	end)
	if success then
		if data then
			-- Data exists for this player
			sessionData[playerUserId] = data
		else
			-- Data store is working, but no current data for this player
			sessionData[playerUserId] = {Money=10, Experience=10}
		end
	else
		error("Cannot access data store for player!")
	end
	print (playerUserId)
	print (sessionData.Money)
end
 
-- Function to save player's data
local function savePlayerData(playerUserId)
	if sessionData[playerUserId] then
		local success, err = pcall(function()
			playerData:SetAsync(playerUserId, sessionData[playerUserId])
		end)
		if not success then
			error("Cannot save data for player!")
		end
	end
end
 
-- Function to periodically save player data
local function autoSave()
	while wait(60) do
		for playerUserId, data in pairs(sessionData) do
			savePlayerData(playerUserId)
		end
	end
end
 
-- Start running 'autoSave()' function in the background
spawn(autoSave)
 
-- Connect 'savePlayerData()' function to 'PlayerRemoving' event
game.Players.PlayerRemoving:Connect(function(player)
	local playerUserId = "Player_" .. player.UserId
	savePlayerData(playerUserId)
end)
 
-- Connect 'setupPlayerData()' function to 'PlayerAdded' event
game.Players.PlayerAdded:Connect(setupPlayerData)
 
return PlayerStatManager
3 Likes

When was the plugin last updated?

Touche. Nov. 22, 2017

Uninstall i guess? Thanks!

I use it and it works fine. Do you have Studio API and HTTP enabled?

Oh, also, you’re not using an ordered data store so I don’t know why you’ve got that ticked

yeah got those set

and yet it does not seem to connect:

Any ideas?

It looks like it’s working to me. You search for PlayerData and PlayerData is displaying in recent connections. If you click that, it should open.

1 Like

Well, this is my plugin, so I guess I should respond!

HttpEnabled isn’t necessary for this to work. And ‘Enable Studio Access to API Services’ is only necessary if you’re writing data using the plugin. You can still get data without the setting on.

Otherwise, I’m a bit confused by what isn’t working for you here. When you connect to a DataStore, you then have to run a search for a specific key (and you have to click the improperly-named “Query” button).

On another note, I am still drafting up plans for completely redoing this plugin. I plan to make it much more user-friendly, so this discussion will probably help with that.


Edit: There’s also an existing bug where the place name sometimes doesn’t show up. So don’t take that as a reason for it not connecting.

7 Likes

Thanks for responding, what doesn’t work is that when I search for the datastore name or any known key, it’s blank. I have not gotten a single result.

Also, in your video, you show that below the place ID field, if the place us connected you see the owner name, etc. I don’t see this as you mentioned in the see in the images above.

@EchoReaper all of those connections had no entries, one of them was even a typo.

Will try again, but not sure what to try different. I have entered every key I know and I have verified bthey exist with print statements in the code.

I will try again when I get home and report back.

Thanks!

I use this plugin often so perhaps I can help, though I’m not exactly sure what you mean when you say that it’s blank. Once you enter a name into the “DataStore Name” box, clicking “connect” should bring up this screen. Does it?

I get the same result as @Planet_Dad, which is no result when searching for the key and Im doing everything correctly. I think your plugin doesnt account for the scope being a string?

1 Like