Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Data Persistence Load GUI?

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

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

3 comments

0

I would if you could save Instances :/

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.

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.