It's for stands datastore in a jojo fighting game. Help please.
I've only tested it on the 1 button but I don't know the issue.
script.Parent.Parent.Parent.CharacterAdded:Wait()
local stands = game:GetService("DataStoreService"):GetDataStore("yoyosall")
local standsdata = nil
local table1
local success, errormessage = pcall(function()
standsdata = stands:GetAsync(script.Parent.Parent.Parent.UserId)
end)
if standsdata then
for key, value in pairs(standsdata) do
print(key)
print(value)
script.Parent.Menu["1"].Text = standsdata["1a"]
script.Parent.Menu["2"].Text = standsdata["2a"]
script.Parent.Menu["3"].Text = standsdata["3a"]
script.Parent.Menu["4"].Text = standsdata["4a"]
script.Parent.Menu["5"].Text = standsdata["5a"]
script.Parent.Menu["6"].Text = standsdata["6a"]
script.Parent.Menu["7"].Text = standsdata["7a"]
script.Parent.Menu["8"].Text = standsdata["8a"]
script.Parent.Menu["9"].Text = standsdata["9a"]
print(key)
print(value)
end
end
script.Stand.Changed:Connect(function()
script.Parent.Parent.Parent.CharacterAdded:Wait()
script.Parent.Parent.Parent.Character.Stand.Stand.Value = script.Stand.Value
if script.Stand.Value ~= "Standless" then
script.Parent.Parent.Parent.Character.Stand.YN.Value = true
elseif script.Stand.Value == "Standless" then
script.Parent.Parent.Parent.Character.Stand.YN.Value = true
end
print("1assigned "..script.Stand.Value)
wait()
table1 = {
["1a"] = script.Parent.Menu["1"].Text,
["2a"] = script.Parent.Menu["2"].Text,
["3a"] = script.Parent.Menu["3"].Text,
["4a"] = script.Parent.Menu["4"].Text,
["5a"] = script.Parent.Menu["5"].Text,
["6a"] = script.Parent.Menu["6"].Text,
["7a"] = script.Parent.Menu["7"].Text,
["8a"] = script.Parent.Menu["8"].Text,
["9a"] = script.Parent.Menu["9"].Text
}
local success, errormessage = pcall(function()
stands:SetAsync(script.Parent.Parent.Parent.UserId, table1)
end)
end)
game.Players.PlayerRemoving:Connect(function(plr2)
table1 = {
["1a"] = script.Parent.Menu["1"].Text,
["2a"] = script.Parent.Menu["2"].Text,
["3a"] = script.Parent.Menu["3"].Text,
["4a"] = script.Parent.Menu["4"].Text,
["5a"] = script.Parent.Menu["5"].Text,
["6a"] = script.Parent.Menu["6"].Text,
["7a"] = script.Parent.Menu["7"].Text,
["8a"] = script.Parent.Menu["8"].Text,
["9a"] = script.Parent.Menu["9"].Text
}
stands:SetAsync(script.Parent.Parent.Parent.UserId, table1)
end)

1 comment
Sorry for the late, but it did work. Thanks!