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

API Services are enabled yet I'm still getting the API Services Error?

Asked by
Moosee 62
6 years ago

Hello, I've made a DataStore in which it'll save the value "Power" I have enabled API Services, HttpService, Create and Save Place API, and yet it still comes out with this error:

API Services rejected request with error: HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden))

Here is the code:

local DataStore =  game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("PowerSaveSystem")

game.Players.PlayerAdded:connect(function(player)
    local leader = Instance.new("Folder", player)
    leader.Name = "leaderstats"
    local Power = Instance.new("IntValue", leader)
    Power.Name = "Power"
    Power.Value = ds:GetAsync(player.UserId) or 0
    ds:SetAsync(player.UserId, Power.Value)
    Power.Changed:connect(function()
        ds:SetAsync (player.UserId, Power.Value)
    end)
end)

game.Players.PlayerRemoving:connect(function(player)
    ds:SetAsync(player.UserId, player.leaderstats.Power.Value)
end)
0
I am sure that this error will only occur in studio abnotaddable 920 — 6y
1
No it would not, because how would the datastore plugins work? hiimgoodpack 2009 — 6y
0
The second parameter in instance.new is depricated the alternative is create instance then do the parent of that instance plus connect is depricated use Connect saSlol2436 716 — 6y
0
Still doesnt work @saSlol2436 Moosee 62 — 6y

Answer this question