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

GetAsnyc is not a valid member of Global data store?

I'm testing stuff out with data stores, and when I tried this script it said GetAsnyc is not a valid member of data store. I did everything correctly what the wiki said to do.

Script:

local ds = game:GetService("DataStoreService"):GetDataStore("TestColor")

while true do
	wait()
	if ds:GetAsnyc("color") == 1 then
		script.Parent.BrickColor = BrickColor.new("Bright blue")
	elseif ds:GetAsnyc("color") == 2 then
		script.Parent.BrickColor = BrickColor.new("Bright red")
	else
		script.Parent.BrickColor = BrickColor.new("Institutional white")
	end
end

1 answer

✓ Accepted answer

GetAsync - you had a typo lol, also DataStores can only have 100 requests per minute server-wide.. by only having wait() for a yeild in your loop(1/30 seconds) you're going to exceed the limit a lot.. So I put wait(5). Also I revised your script a bit.

local ds = game:GetService("DataStoreService"):GetDataStore("TestColor")
local colors = {BrickColor.new('Bright blue'),BrickColor.new('Bright red'),BrickColor.new('Institutional white'}

while wait(5) do
	script.Parent.BrickColor = colors[ds:GetAsync('color')] or BrickColor.new('Dark stone grey')
end

1 comment

0

Thx! Typos xD

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