Script to change value:

game.Players.PlayerAdded:Connect(function(plr)
	local job = game.Players.LocalPlayer

	if plr.Team.TeamColor == BrickColor.new("Lapis") then
		plr.leaderstats.job.Value = "Programmer"
	else
		print("Debug")
	end
end)

Datastore:

local DDService = game:GetService("DataStoreService"):GetDataStore("Hello")
game.Players.PlayerAdded:connect(function(plr)

local uniqueKey = "id-"..plr.userId
local leaderstats = Instance.new("IntValue", plr)
local savevalue = Instance.new("IntValue")
local savevalue2 = Instance.new("StringValue")
leaderstats.Name = "leaderstats"
savevalue.Parent = leaderstats  
savevalue.Name = "Cash"
savevalue2.Name = "Job"
savevalue2.Parent = leaderstats


local GetSaved = DDService:GetAsync(uniqueKey)
if GetSaved then
	savevalue.Value = GetSaved[1]
	savevalue2.Value = GetSaved[1]
else
	local NumbersForSaving = {savevalue.Value, savevalue2.Value}
	DDService:SetAsync(uniqueKey,NumbersForSaving)
	
end	

end)

1 comment

0

Don't copy alvinbloxx videos