I am not speaking to you. You can still fire them with exploits regardless.
Iām only saving the data for the one player ⦠spamming it in any form isnāt going to matter.
Iām not here to debate you ⦠thatās your program. I do checks for anything odd.
Then kick and permanently ban the player. Your 1st hack call would earn you that.
I was thinking ⦠if youāre still having problems try to rem off them pcall calls.
Sometimes that can show an error you wouldnāt see otherwise. You do have API set to on correct?
Also, alessdai has a valid point ⦠Why are you sending data reads/saves via remotes? Itās hard enough to debug these data stores the way it is. Anything Iām telling you could be totally off considering everything else youāre doing. Iām commenting on what Iāve posted.
They can set off your remotes unless youāre really set up to catch that ā¦
The way itās set up, the player canāt spam the remote event. Plus, thereās nothing to gain from spamming it if you figure out a way to.
I removed the pcalls, and it wonāt do anything, but it doesnāt show any errors. Yes, I have API on. Iām using remotes because I want to add a player to the store when they pass a test done via gui, and I want to remove players from the store when I click a gui button.
Doesnāt it use user ids to remove data? Iām using player names, not user ids.
You need to use whatever you used for your key ⦠most do use the player ID. The fact your Data Store can be spammed with remotes should be unacceptable. I do, do checks for odd actions but I also donāt open up the front door for hackers. It also makes helping you next to impossible with a data system I would never use or care to debug. Data Stores kind of throw fits about how they work. Itās far from consistent behavior when it comes to timing. Adding remotes to that would make it next to impossible to know where the timing error was.
Is there any other way I could communicate between server and client? Also, what makes the 300 robux data store editor better than all the other free ones? Looking at the comments, there are some concerning ones that make me think it might be a waste of 300 robux. Iāve already tried some of the free ones, and they donāt work, so why would this work?
I used it to delete data and more so to look at the data checking if everything is working ok. Seems to work fine. You could do everything it can yourself however. Only tool Iāve paid for. Itās nothing that great but itās can do what it says ⦠I think you should try looking at using the IDs ā¦
something like dataKey:SetAsync(plr.CharacterAppearanceId,plr.leaderstats.Coins.Value)
Why are you not just using what I posted, modified ā¦
You could clog all requests and basically make a server dysfunctional. Whatās that? Little jimmy wants his progress to be saved? Nope!!
Ok, I think I pretty much understand now. Since my setup looks pretty similar to the example one you showed, the problem must be with the remote events like yāall suggested. So what can I use instead of remote events. To understand why I kinda need them, hereās the context:
So, long story short, Iām making a restaurant business. These scripts are for the application center, where customers can take a 10 question test, and, if they pass, they can become a trainee. I tried to use a auto-ranking system with noblox.js, but I got REALLY confused, so I went with this instead. Now, I want to have them take the test, and, if they pass, their name is added to a dataStore. Iād prefer their name because on roblox, you cant search for players by userId. Later, Iāll join in, and since I am high enough rank in the group, a script will read all items of the data store, then it will fire a remote event to me to make a gui for each key(player name). Hereās where the remote events come in. I have two concepts to work with: gui and DataStores. DataStores can only be accessed through a server-side scripts, and gui must be worked with on the client side. Otherwise, the client wouldnāt be able to see the gui changes. The only way I can think of to communicate is RemoteEvents, so we have 3(?) options I can think of:
- Use something other than remote events to communicate between server and client.
- Change the scripts some way to make it work with RemoteEvents
3? Take advantage of ReplicatedStorage(might not work)
PS: Thank you for your patience, took me quite a while to understand.
Ah, I see. So, what could I use other than RemoteEvents?
I just realized Iām been giving you examples of an ordered data store. /facepalm
Also ⦠I am sorry I didnāt see that GetOrderedDataStore, again /facepalm
1/2 this hassle has been my fault.
You may want to start a whole new program for that also ⦠I know I know
GetOrderedDataStore is for a high score board. But you can do that other ways with just pulling the data. Once you get this down you can mess around with GetOrderedDataStore itās pretty much the same thing. Also calling both them together like that in the pcall is a bit sloppy.
*Edit You do have to slipt them up and make 2 pcalls
last one ā¦
local Player --- Addded this just for the test on the bottom remove it
--------------------------------
local dataStoreService = game:GetService("DataStoreService")
local CoinKey = dataStoreService:GetDataStore("Coins")
local LevelKey = dataStoreService:GetDataStore("Level")
game.Players.PlayerAdded:Connect(function(plr)
Player = plr.Name --- Addded this just for the test on the bottom remove it
local Iv, ls = nil, Instance.new("Folder")
ls.Name = "leaderstats" ls.Parent = plr
Iv = Instance.new("IntValue")
Iv.Name = "Level" Iv.Parent = ls
Iv = Instance.new("IntValue")
Iv.Name = "Coins" Iv.Parent = ls
local sus, err = pcall(function()
ls:WaitForChild("Level").Value = LevelKey:GetAsync(plr.UserId, "Level") or 0
end) if not sus then warn(err) end
local sus, err = pcall(function()
ls:WaitForChild("Coins").Value = CoinKey:GetAsync(plr.UserId, "Coins") or 0
end) if not sus then warn(err) end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local sus, err = pcall(function()
LevelKey:SetAsync(plr.UserId, plr.leaderstats.Level.Value)
end) if not sus then warn(err) end
local sus, err = pcall(function()
CoinKey:SetAsync(plr.UserId, plr.leaderstats.Coins.Value)
end) if not sus then warn(err) end
end)
--------------------------------
wait(3) --- Remove this test also
game.Players:WaitForChild(Player).leaderstats.Coins.Value = 4 ---
game.Players:WaitForChild(Player).leaderstats.Level.Value = 4
Oh, so I could make the fact whether they passed or not a boolean value, and then, when they leave, it will save to the data store. That would eliminate the need for remote events to set the keys. How could I do it to remove the keys?
Oh wait, could I make it a command to remove keys to eliminate the use of remote events?
It will if you change their level ā Iām talking about the last script I posted
Ok here are my scripts with the new changes, can you see if these look good?
Hereās the script that when I join the game, it gets whether Iāve passed or not:
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local passStore = DataStoreService:GetDataStore("PassStore")
Players.PlayerAdded:Connect(function(plr)
local success, value = pcall(function()
return passStore:GetAsync(plr.UserId)
end)
local statsFolder = Instance.new("Folder")
statsFolder.Name = "StatsFolder"
statsFolder.Parent = plr
local pass = Instance.new("BoolValue")
pass.Name = "Pass"
pass.Parent = statsFolder
if success then
pass.Value = value
else
pass.Value = false
end
end)
Hereās the script that adds me to the data store when I leave if Iāve passed:
local DataStoreService = game:GetService("DataStoreService")
local passStore = DataStoreService:GetDataStore("PassStore")
local Players = game:GetService("Players")
Players.PlayerRemoving:Connect(function(plr)
local statsFolder = plr:WaitForChild("StatsFolder")
local pass = statsFolder:WaitForChild("Pass")
if pass == true then
local success, errorMessage = pcall(function()
passStore:SetAsync(plr.UserId, true)
end)
if not success then
warn(errorMessage)
end
if success then
print(plr.UserId)
end
end
end)
Hereās the script that removes the player from the data store when I type a command:
local commands = {}
local prefix = "/"
local DataStoreService = game:GetService("DataStoreService")
local passStore = DataStoreService:GetDataStore("PassStore")
commands.remove = function(sender,arguments)
if sender:GetRankInGroup(11635716) >= 254 then
local userId = arguments[1]
local success, errorMessage = pcall(function()
passStore:RemoveAsync(userId)
end)
if not success then
warn(errorMessage)
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(message,recipient)
local splitString = message:split(" ")
local slashCommand = splitString[1]
local command = slashCommand:split(prefix)
local commandName = command[2]
print(commandName)
if commands[commandName] then
local arguments = {}
for i = 2, #splitString, 1 do
table.insert(arguments,splitString[i])
end
commands[commandName] (player,arguments)
end
end)
end)
So I think these are all good, but when I leave, thereās no output from the script that adds me to the data store.