✓ Accepted answer
You shouldn't be using DataPersistance.
Simply use Datastores to save your data, and if the Value isn't there to load, it randomizes one. Example:
local DataStore = game:GetService("DataStoreService"):GetDataStore("PlayerStat")
game.Players.PlayerAdded:connect(function(plr)
local Data = ("Data" .. plr.UserId)
local DataTable = DataStore:GetAsync(Data) or {math.randomseed(1,5),0,0,0}
local Data = Instance.new('IntValue', plr)
Data.Name = 'Data'
local random = Instance.new('IntValue', Data)
random.Name = 'RandomMove'
random.Value = DataTable[1] or math.random(1,5)
end)
This is just a bad example I quickly made, it probably even has mistakes. You'd still need to add the end of the script that saves it once they leave, but I'm not going to take that much time making you an actual script. This is just to help you understand how Datastores look like, so please research them and you'll find that easy.
1 comment
You can check to see if the player already has one of the five of the skills.