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

I tried another method with Bools and its still not working? (Help please)

So i tried another method of doing this which i was doing in the following question but it STILL won't save if people find out about this it will crash the games entire economy, here is my script.

local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("BoolSave")

game.Players.PlayerAdded:connect(function(player)
local bool = Instance.new("BoolValue")
bool.Parent = player
bool.Name = "Used1"
bool.value = false

 bool.Value = ds:GetAsync(player.UserId) or false
 ds:SetAsync(player.UserId, bool.Value)
end)


game.Players.PlayerRemoving:connect(function(player)
 ds:SetAsync(player.UserId, player.Used1.Value)
end)

4 comments

0

Legit though it is a code and if people find out that you can use it infinitely when you rejoin they'll ruin the game and i might have to wipe some peoples data

0

I've tried making this script before and I've never been able to fix it. If someone posts a solution, that would be extremely helpful :)

0

There is an error on line 08. You used a lower case v for Value. Now im not sure if that will fix it all, but that's an error there

0

@DarkDanny Hawk-eyed, I missed that lower case v

1 answer

try this, note that the script for changing the value of the bool should be something like this... player.BoolSaver.Saved1.Value = true(or false, depeding on the scenario)

local DataStoreService = game:GetService("DataStoreService")

	local ds1 = DataStoreService:GetDataStore("BoolSave")	

game.Players.PlayerAdded:Connect(function(plr)
	local folder = Instance.new("Folder", plr)
	folder.Name = "BoolSaver"
	local saved1 = Instance.new("BoolValue", folder)
	saved1.Name = "Saved1"
	
		Saved1.Value = ds1:GetAsync(plr.UserId) 
	ds1:SetAsync(plr.UserId, Saved1.Value)

Saved1.Changed:connect(function()
		ds1:SetAsync(plr.UserId, Saved1.Value)
	end)

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