Please could you help just use some of your time to FIX this then.
And I can't get an output =/
But look for obvious signs of errors =/
wait(1)
Player = script.Parent.Parent.Parent.Parent.Parent
Text = script.Parent.Text
Button = script.Parent
function OC()
Button.Text = "Loading Data"
Player:WaitForDataReady()
stats = Player:FindFirstChild("leaderstats")
if stats then
Button.Text = "Loading"
c = stats:GetChildren()
for i = 1,#c do
wait()
if c[i].className == "IntValue" then
c[i].Value = Player:LoadNumber(c[i].Name)
end
Player.Quest1.Value = Player:LoadBoolean("Quest1")
Player.Backpack = Player:LoadInstance("Backpack")
end
Button.Text = "Load Done"
else
Button.Text = "No stats"
end
wait(3)
Button.Text = "Load"
end
Button.MouseButton1Click:connect(OC)
I know that error's Well Does not work.
But this one I'm not sure, I can't test it. Without saving =/
script.Parent.MouseButton1Down:connect(function(p)
local Saver = script.Parent.Parent.Parent.Parent.Parent:FindFirstChild("leaderstats")
if Saver ~= nil then
Saver.Parent:WaitForDataReady()
Saver.Parent:SaveNumber("Xp", Saver.Xp.Value)
Saver.Parent:SaveNumber("Gold", Saver.Gold.Value)
Saver.Parent:SaveBoolean("Qu1", Saver.Parent.Quest1.Value)
Saver.Parent:SaveNumber("Level", Saver.Level.Value)
local score = Saver.Parent.Backpack:GetChildren() -- Targeting the scores before the player is gone
for i = 1, #score do
Saver.Parent:SaveInstance("Backpack", score)
end
end
end)
Thanks,
Ford.
Its meant to save and Load
Quest1 Bool value in the player
Save the Backpack, In the player. Duh.
Save all of the leaderstats
Gold
Xp
Level
Exactly as I spelt them.
No error's Just won't Save/Load. |