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)