I’m trying to create an execution system, where there’s an IntValue that keeps track of the death’s a player has, then a Boolean value is turned to true and on their next death all the stuff will occur, how do I set up the saving Int and Boolean Values
the saving IntValue must be parented to the player not character in order for it to save if you want it to save not only in-game but when they rejoin it will be the same then use a datastore
So would I make a new IntValue with .PlayerAdded() inside of every Player? and then use a data store to change the value of the IntValue?
yes if you want it to save whenever a player leave but if you want it just to save in game only and when player leave it wont save then dont use datastore
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new("Folder", Player)
leaderstats.Name = "leaderstats"
local deaths = Instance.new("IntValue", Player)
deaths.Name = "Deaths"
local data
local success, err = pcall(function()
data = DeathStore:GetAsync(Player.UserId.."-deaths")
end)
if success then
deaths.Value = data
end
end)