Well, I made a key changing system, in case you don’t like how they are you can change them, but my problem is that when I start the game and I go to game.Players.LocalPlayer.keys. (Here are my stringValue)
they are all in the same value and not as I put it in the script
local ds = game:GetService("DataStoreService")
local valueDs = ds:GetDataStore("valueDs")
game.Players.PlayerAdded:Connect(function(player)
local Keys = Instance.new("Folder")
Keys.Name = "Keys"
Keys.Parent = player
local MenuKey = Instance.new("StringValue")
MenuKey.Name = "MenuKey"
MenuKey.Parent = Keys
MenuKey.Value = "M"
local InteractiveKey = Instance.new("StringValue")
InteractiveKey.Name = "InteractiveKey"
InteractiveKey.Parent = Keys
InteractiveKey.Value = "F"
local AgacharseKey = Instance.new("StringValue")
AgacharseKey.Name = "AgacharseKey"
AgacharseKey.Parent = Keys
AgacharseKey.Value = "C"
local EmotesKey = Instance.new("StringValue")
EmotesKey.Name = "EmotesKey"
EmotesKey.Parent = Keys
EmotesKey.Value = "B"
local data
local success, Err = pcall(function()
data = valueDs:GetAsync(player.UserId.."-MenuKey")
data = valueDs:GetAsync(player.UserId.."-InteractiveKey")
data = valueDs:GetAsync(player.UserId.."-AgacharseKey")
data = valueDs:GetAsync(player.UserId.."-EmotesKey")
end)
if success then
MenuKey.Value = data
InteractiveKey.Value = data
AgacharseKey.Value = data
EmotesKey.Value = data
else
print("No se pudieron guardar los datos")
wait(Err)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local data = {
["MenuKey"] = player.Keys.MenuKey.Value,-- Repeat for all of them
["InteractiveKey"] = player.Keys.MenuKey.Value, -- Repeat for all of them
["AgacharseKey"] = player.Keys.MenuKey.Value, -- Repeat for all of them
["EmotesKey"] = player.Keys.MenuKey.Value -- Repeat for all of them
}
local success,Err = pcall(function()
valueDs:SetAsync(player.UserId, data)
end)
if success then
print("Guardado exitosamente")
else
print("Error al guardar datos")
warn(Err)
end
end)