Here's my script: Script in ServerScriptService
local datastore = game:GetService("DataStoreService")
local MyMoney = datastore:GetDataStore("MoneyData")
local MyRuby = datastore:GetDataStore("RubyData")
local bsnss = datastore:GetDataStore("BusinessOwned")
game.Players.playerAdded:connect(function(player)
local Money = Instance.new("IntValue", player)
Money.Name = "Money"
local Ruby = Instance.new("IntValue", player)
Ruby.Name = "Rubys"
local bsnes = Instance.new("Folder", player)
bsnes.Name = "Businesses"
local ps = Instance.new("BoolValue", bsnes)
ps.Name = "Storage"
ps.Value = false
local aprt = Instance.new("BoolValue", bsnes)
aprt.Name = "Apartment"
aprt.Value = false
Money.Value = MyMoney:GetAsync(player.UserId) or 1000
MyMoney:SetAsync(player.UserId, Money.Value)
Ruby.Value = MyRuby:GetAsync(player.UserId) or 10
MyRuby:SetAsync(player.UserId, Ruby.Value)
ps.Value = bsnes:GetAsync(player.UserId) or false
bsnes:SetAsync(player.UserId, ps.Value)
game.Players.PlayerRemoving:connect(function()
MyMoney:SetAsync(player.UserId, Money.Value)
MyRuby:SetAsync(player.UserId, Ruby.Value)
end)
end)

4 comments
So would I just need to add that into the beginning of my script?
Yeah. Then you treat 1 and 2 as true or false. This also works for strings, and since datastores don't support strings this is also the method I use.
Could you write or edit out the example for one of my bool values, I'm sorry this just isn
making sense to me