--services
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local TweenService = game:GetService("TweenService")
--folders
local Remotes = ReplicatedStorage:WaitForChild('Remotes')
local Modules = ReplicatedStorage:WaitForChild('Modules')
local Values = ReplicatedStorage:WaitForChild("Values")
--mods
local functions = require(Modules.functions)
local config = require(Modules.Config)
local ZonePlus = require(Modules.Zone)
local DataStore2 = require(Modules.Datastore2)
local DataEditor = require(Modules.DataEditor)
local PlayerModule = require(Modules.Player)
local uniqueDataKey = "MAINUNIQUEKEY"
game.Players.PlayerAdded:Connect(function(player: Player)
local inQueue = Instance.new("BoolValue", player)
inQueue.Name = "inQueue"
inQueue.Value = true
DataStore2:Combine(uniqueDataKey, "PlayerData505050")
local Values = Instance.new("Folder", player)
Values.Name = "Values"
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local EmotesData = DataStore2("Emotes", player)
for valueName, valueData in config.Values do
local storedData = DataStore2(valueName, player)
local value:NumberValue = Instance.new(valueData.InstanceType)
value.Value = storedData:Get(valueData.DefaultValue)
value.Name= valueName
value.Parent = Values
local leaderstatVal
if valueData.showLeaderstats then
leaderstatVal= value:Clone()
leaderstatVal.Parent = leaderstats
end
storedData:OnUpdate(function(newValue)
value.Value = newValue
if leaderstatVal then leaderstatVal.Value = newValue end
end)
end
PlayerModule(player)
end)
I've tried changing the main key, combine scope key but nothing seems to reset the old data
** You are now Level 2! **