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

How Would I Re-Assemble This Script To Save And Change Values In Tables?

So, I've created a table using HTTP Service and JSON:Encode and JSON:Decode.

I can't figure out how to save this table and change the values inside of it?

ServerScript inside ServerScriptService:

game.Players.PlayerAdded:Connect(function(player)
	local swordData = Instance.new("Folder",player)
	swordData.Name = "SwordData"
	
	local ns = Instance.new("BoolValue",swordData)
	ns.Name = "NS"
	
	
	local http = game:GetService("HttpService")
	
	local items =
	{
		Swords = 
		{
		["Normal Sword"] = true,
		["Cool Sword"] = false
		}
	}	
	
	wait()
	
	local savedTable = http:JSONEncode(items)
	
	print(savedTable)
	
	local loadedTable = http:JSONDecode(savedTable)
	
	print(loadedTable.Swords["Normal Sword"])
	
	player.SwordData.NS.Value = loadedTable.Swords["Normal Sword"]
end)

Any help would be appreciated!

1 answer

✓ Accepted answer

well you need to use the Datastore service, datastore service saves strings, and numbers to the Roblox Servers, you can retrieve the data and do whatever you want to with it; since i don't have much time as of right now, Here are videos and articles that explain Datastore service

ALvinBlox

Roblox Docs;

Roblox Doc Article

Good luck!

1 comment

0

Thanks!

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