Hello so i am near to finish my shop gui but its still needs one thing i trying to find where and how to save boolvalues in local player maybe someone can say me? Thank you.
COMMUNITY QUESTION
How to Save a Bool Values. in a local player?
2 answers
local ds = game:GetService("DataStoreService")
local bool = ds:GetDataStore("BoolSaving")
game.Players.PlayerAdded:Connect(function(plr)
local boolValue = Instance.new("BoolValue")
boolValue.Parent = plr
boolValue.Name = "BoolValue"
boolValue.Value = bool:GetAsync(plr.UserId) or false
end)
game.Players.PlayerRemoving:Connect(function(plr)
bool:SetAsync(plr.UserId, plr.BoolValue.Value)
end)
This will create a BoolValue and save it when the player leaves
dont works i dont know why.
1 comment
0
i made that if buy button will be clicked it gives bool value true then if player connects with bool value true its needs to show a equip button not buy see its dont save a true bool value.?
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
its dont saves? that its true..
If you test it in-game it will work, since you dont leave the game in studio
kk ill see
kk il try leaving game from studio and trying it play in roblox game engine
still not woks i need to repurchase every time i cope to server again and its dont save that still..
TEST IT IN-GAME, NOT IN ROBLOX STUDIO