Need Help saving the boolvalue,

How do i save the Boolvalue?? in datastore?

local DataStoreService = game:GetService("DataStoreService")

local DataStore = DataStoreService:GetDataStore("CodeDataStore")

local player = game.Players.LocalPlayer


local gui = script.Parent.CodeUi


local TypeCode = gui.InputCode

local ConfirmCode = gui.SubmitButton

local Code1 = "New"

ConfirmCode.MouseButton1Click:Connect(function()
	if TypeCode.Text == Code1 and gui.Confirmed.Value == false then
		local CloneSword = game.ReplicatedStorage.ClassicSword:Clone()
		script.Parent.CodeUi.Confirmed.Value = true
		script.Parent.CodeUi.SubmitButton.Text = "Code Redeemded"
		CloneSword.Parent = player.Backpack
		wait(1.5)
		script.Parent.CodeUi.SubmitButton.Text = "Submit"
		
		end
end)

ConfirmCode.MouseButton1Click:Connect(function()
	if TypeCode.Text == Code1 and gui.Confirmed.Value == true then
		gui.SubmitButton.Text = "Already Redeemded"
		wait(1.5)
		gui.SubmitButton.Text = "Submit"
	end
end)

You should only use the dev forum for help if you only really can’t find any. There are many (and many) resources on how to use datastoreservice. I suggest you go watch one of those videos right now. Here’s a helpful one by @Alvin_Blox: Roblox DataStore Tutorial - Data Stores & Saving Data - Scripting Tutorial - YouTube

1 Like