Okay, so I recently posted an error with my code a day or two ago, that turned out to be a spelling error -_-. Anyway, I have found yet another error.
The script is supposed to display the players level on the leaderboard. I'm not quite sure what's wrong, maybe you can help me figure it out. Here's the code:
local DataStore = game:GetService("DataStoreService"):GetDataStore("Level")
game.Players.PlayerAdded:connect(function(player)
local leaderstats = Instance.new("IntValue", player)
leaderstats.Name = "leaderstats"
local levelstats = Instance.new("IntValue", leaderstats)
levelstats.Name = "Level"
local key = "user_" .. player.userId
player.leaderstats.Level.Value = DataStore:getAsync(key)
if DataStore:getAsync(key) == 0 then
DataStore:setAsync(key, 1)
local connection = DataStore:OnUpdate(key, function(value)
player.leaderstats.levelstats.Value = DataStore:getAsync(key)
end)
end
end)
Now, here's the error it's printing (in orange letters): 17:00:47.876 - "GlobalDataStore.getAsync" should be "GetAsync" in Workspace.Leaderstats 17:00:48.195 - httpGet https://api.roblox.com/gametransactions/getpendingtransactions/?PlaceId=179245784&PlayerId=24031098 failed. Trying again. Error: HTTP 403 (Forbidden). Elapsed time: 0.314093
Please help me figure out what the problem is and fix it!

1 comment
Orange isn't an error. Just an exception. Exceptions don't break the code. Maybe post an image link so we can see exactly what you're seeing, just in case.