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

Soo uh, my DataStore2 Script is sending 35 requests in 2 seconds so help?

Asked by 4 years ago

So i followed the developer forums of "DataStore2"

I did not want the shop system so i removed that part of it, and i replaced coins with skills

01local DataStore2 = require(1936396537)
02local ReplicatedStorage = game:GetService("ReplicatedStorage")
03local Players = game:GetService("Players")
04local ServerScriptService = game:GetService("ServerScriptService")
05 
06game.Players.PlayerAdded:Connect(function(plr)
07    local skillsDataStore = DataStore2("skills", plr)
08    local function callRemote(value)
09        ReplicatedStorage.SkillUpdate:FireClient(plr, value)
10        end
11    callRemote(skillsDataStore:Get(0))
12    skillsDataStore:OnUpdate(callRemote)
13end)

It seems to work except for the Get(0) part, if I set it to 100 then it still stays 0 also its weird, if i remove this line on the script that makes the leaderstats then everything works except for the :Get() part

01game.Players.PlayerAdded:Connect(function(plr)
02 
03    local leaderstats = Instance.new("Folder", plr)
04    leaderstats.Name = 'leaderstats'
05 
06    local skill = Instance.new("IntValue", leaderstats)
07    skill.Name = 'Skill'
08 
09    skill.Value = 100       -- this line is broken
10    end)

the truss.Value works PERFECTLY except that it spams the request for the DataStore extremely fast

1 answer

Log in to vote
0
Answered by 4 years ago

Hey there, I suggest watching this video made by the community champion AlvinBlox: [(https://://www.youtube.com/watch?v=hBfMfB0BwGA)]

It should help alot as I am an AlvinBlox premium subscriber and I find him really useful!

Ad

Answer this question