Is there a way to check datas value?

Im trying to make a thing only 1 player can get so I have a datastore but how do I check if its true or not?

Ive tried this so far

NaturalRinnegan:SetAsync(true,"NaturalRinnegan"..DataWipe)


if NaturalRinnegan == true then
	warn("NATURAL RINNEGAN TAKEN")
end

You will want to check out Data Store Service: Data Stores | Roblox Creator Documentation. You can use the Item Name as your key and set it to be true using :SetAsync when it is purchased. You can use :GetAsync to see whether it has been purchased. This will require an intermediate level of scripting knowledge. From the code segment above it seems like you might be a beginner. I would highly recommend watching tutorials from AlvinBlox - YouTube or TheDevKing - YouTube. I hope this helps!

I’m trying to run the datastore on the game not a player though thats whats confusing me

Just use a key for the datastore that is not player dependant?

game:GetService("DataStoreService"):SetAsync("ServerData",{
NaturalRinnegan = true
}, "1") -- one for scope bascially data version


local data = game:GetService("DataStoreService"):GetAsync("ServerData")
if data.NaturalRinnegan == true then
	warn("NATURAL RINNEGAN TAKEN")
end

-- you could alternatively use MemoryService.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.