Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Getting "Request Rejected" on GetAsync()?

Asked by
Nexx 51
9 years ago

I am a bit new to datastores, and on a recent project no matter what I do I get a "request rejected" output where it says playerData:SetAsync()

It was working fine before until recently, not sure what happened. Anyone have any clue? It would be greatly appreciated!

    local playerData = game:GetService("DataStoreService"):GetDataStore("Players", player.userId)
    if(playerData:GetAsync("Data") == nil) then

        local success, message = pcall(function()

        playerData:SetAsync("Data", {Credits=0,
            Cases={},
            Guns={
                Shotgun={"Default"},
                LMG={"Default"},
                SMG={"Default"},
                Rifle={"Default"}
                },
            Characters={
                Runner={},
                Tank={},
                Medic={},
                Hunter={},
                Monster={}
                },
            Hunter={Rank=1, XP=0, MaxXP=437, Gun="Default", Character="Default"},
            Medic={Rank=1, XP=0, MaxXP=437, Gun="Default", Character="Default"},
            Runner={Rank=1, XP=0, MaxXP=437, Gun="Default", Character="Default"},
            Tank={Rank=1, XP=0, MaxXP=437, Gun="Default", Character="Default"},
            Monster={Rank=1, XP=0, MaxXP=437, Character="Default"}
        })

        end)

        if not success then
            print("An error occurred: " .. message)
        end

    end

Edit: I am going to believe that this is a roblox side bug if no one can actually give me an answer to the problem.

0
Are you getting the error in online servers? As well, you might want to swap `"Players"` and `player.userId`: the scope of the data store is the second argument. adark 5487 — 9y
1
Players is suppose to be the key, while the user id is the scope. So i can insert their user id to get the data on the player. Also, this is on servers on studio. Not play solo, I would double check on actual servers but Roblox currently has a massive bug where you can set up universes anymore. So i cant even test the game on roblox right now Nexx 51 — 9y
1
That makes sense. Actually pretty clever. I'll steal that. I'm still looking into the bug here, but I can't find out anything so far. adark 5487 — 9y
0
Hey Adark, someone on RBXDev was able to help me out. Apparently the only way to currently get it working on studio is if i open it directly from roblox, which wasnt the case before. My code was fine. Thanks for helping though! Nexx 51 — 9y

1 answer

Log in to vote
0
Answered by
AmiracIe 175
9 years ago
0
I looked into that, and sadly it didn't help :/ I know im not sending too much data at once. At least I hope this isn't too much data for ROBLOX to handle Nexx 51 — 9y
0
I saw your [tweet](https://twitter.com/NexxCR/status/557590216111050753). I'm sorry :P AmiracIe 175 — 9y
Ad

Answer this question