✓ Accepted answer
In order to use datastores, you must require the service which you have done local DS = game:GetService("DataStoreService") and then from the datastore service, get the specific datastore you are looking for. For instance local MyDataStore = DS:GetDataStore('Datastore name here'), in which you are then looking inside of a datastore rather than looking in the service itself.
You should also make sure you are looking at a specifc players data when :GetAsync or otherwise it will be the same for all users. You can do this by adding in a prefix when you :GetAsync, for example MyDataStore:GetAsync(plr.UserId.."TFinish").
By adding in a prefix you must also change the saving process. I have edited this below.
Here is the updated code that should work:
local DS = game:GetService("DataStoreService")
local MyDataStore = DS:GetDataStore('Infomation')
local NewPlayerValueName = "NewPlayer"
local RS = game:GetService("ReplicatedStorage")
local Remote = RS.TutorialFinish
game.Players.PlayerAdded:Connect(function(plr)
if MyDataStore:GetAsync(plr.UserId.."TFinish") then
plr.PlayerGui.Finish.Visible = false
plr.PlayerGui.Tutorial.Visible = false
plr.PlayerGui.Tutorial2.Visible = false
plr.PlayerGui.Tutorial3.Visible = false
end
end)
Remote.OnServerEvent:connect(function(plrname)
MyDataStore:SetAsync(plrname.UserId.."TFinish", true)
end)
I hope you also realise that by firing the Remote Event the Frames .Visible value will not change as it only works when the player joins the server, or rejoins for that matter.
9 comments
Im confused why you made a variable thats longer than what it holds.
GetAsync is a function of GlobalDataStore which you get by DataStoreService:GetDataStore(unique_key)
maybe he wanted to use it multiple times but if not, lol
oh k xd
Unless your GUI was made by the server this wont work.
Even if using something multiple times you'd still have to type more in the end.
local abcdefg = "abc" -- super gross and inefficient
if he were to want to change the value in the future it would only be once
Well he didnt even use it lol.