I was doing a instagram system to my game, the UI is all done i think but i was wondering how i would do it with datastore, i made a short system that allows the users to search for players but when you click in the name that pop up in the search system you can’t open the profile with the data saved in the person profile. Here’s the script that should open the profile(im new to this type of datastore so i don’t really know how to use it)
local DataStoreService = game:GetService("DataStoreService")
local IG = DataStoreService:GetDataStore("PCLig")
script.Parent.MouseButton1Click:Connect(function()
local Profile = script.Parent.Text
local ID = game.Players:GetUserIdFromNameAsync(Profile)
local plr = game.Players:GetPlayerByUserId(ID)
local Template = script.Parent.Parent.Parent.Parent.Parent.Template
Template.Pname.Text = plr.Name
local success, discoveredDataStore = pcall(function()
IG:GetAsync("PFP"..plr.UserId)
end)
local success2, discoveredDataStore2 = pcall(function()
IG:GetAsync("DESC"..plr.UserId)
end)
if success then
if discoveredDataStore then
for i,data in pairs(discoveredDataStore) do
Template.PFP.Image = data[1]
end
end
end
if success2 then
if discoveredDataStore2 then
for i,data in pairs(discoveredDataStore2) do
Template.Desc.Text = data[1]
end
end
end
end)