Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Data Persistence Load GUI?

Asked by 8 years ago

I'm working on an virtual phone, and I'm looking to save Apps, but the only thing stopping me from doing that is this script, it won't work...can someone please help me?

game.Players.PlayerRemoving:connect(function(p)
p.CharacterAdded:wait()

 MainPhone = p.PlayerGui["RoOS Phone"]["Screen"]["Windows"].FindFirstChild("Phone")
    if MainPhone then
        p:SaveInstance("Phone_datastore", p.Character)
    end
end)

game.Players.PlayerAdded:connect(function(p)

 MainPhone = p.PlayerGui["RoOS Phone"]["Screen"]["Windows"]["Phone"];
p.CharacterAdded:wait()
datafolder = p:LoadInstance("Phone_datastore");
apps = datafolder["App Files"];
Home = datafolder["Screen"]["explorer.exe"]["Homescreen"]["homeScreen"];

    MainPhone["App Files"]:Remove();
    MainPhone["Screen"]["explorer.exe"]["Homescreen"]["homeScreen"]:Remove();

    apps.Parent = MainPhone;
    Home.Parent = MainPhone["Screen"]["explorer.exe"]["Homescreen"]["homeScreen"];

end)

1 answer

Log in to vote
0
Answered by 8 years ago

I recommend converting this to a data store as data persistence is now depreciated.

0
I would if you could save Instances :/ MysticalMod 0 — 8y
0
I would use a system of bool values to check if they have bought the item and then copy the item over to the player. Not to use the item directly. BobserLuck 367 — 8y
0
That sounds like a good idea, but then all apps would have to be set to a price, and not be free but I guess it would grab revenue, hm thanks for the tip. MysticalMod 0 — 8y
Ad

Answer this question