Soo uh, my DataStore2 Script is sending 35 requests in 2 seconds so help?
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
01 | local DataStore 2 = require( 1936396537 ) |
02 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
03 | local Players = game:GetService( "Players" ) |
04 | local ServerScriptService = game:GetService( "ServerScriptService" ) |
06 | game.Players.PlayerAdded:Connect( function (plr) |
07 | local skillsDataStore = DataStore 2 ( "skills" , plr) |
08 | local function callRemote(value) |
09 | ReplicatedStorage.SkillUpdate:FireClient(plr, value) |
11 | callRemote(skillsDataStore:Get( 0 )) |
12 | skillsDataStore:OnUpdate(callRemote) |
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
01 | game.Players.PlayerAdded:Connect( function (plr) |
03 | local leaderstats = Instance.new( "Folder" , plr) |
04 | leaderstats.Name = 'leaderstats' |
06 | local skill = Instance.new( "IntValue" , leaderstats) |
the truss.Value works PERFECTLY except that it spams the request for the DataStore extremely fast