Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

local DataStore2 = require(1936396537)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

game.Players.PlayerAdded:Connect(function(plr)
	local skillsDataStore = DataStore2("skills", plr)
	local function callRemote(value)
		ReplicatedStorage.SkillUpdate:FireClient(plr, value)
		end
	callRemote(skillsDataStore:Get(0))
	skillsDataStore:OnUpdate(callRemote)
end)

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

game.Players.PlayerAdded:Connect(function(plr)

	local leaderstats = Instance.new("Folder", plr)
	leaderstats.Name = 'leaderstats'
	
	local skill = Instance.new("IntValue", leaderstats)
	skill.Name = 'Skill'

	skill.Value = 100       -- this line is broken
	end)

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

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.