Hi all,
I'm new to using DataStoreService. I'm having an issue where I'm unable to set a StringValue's Value to the data loaded from a DataStore. I'm probably being exceedingly stupid here, but I can't figure it out. The function is being called correctly via pcall at the end of the definition.
coroutine.resume(coroutine.create(function () game.Players.PlayerAdded:connect(function(player) local function getData() local uid = player.UserId local DataStoreService = game:GetService("DataStoreService") local FirstName = DataStoreService:GetDataStore("FirstName") local LastName = DataStoreService:GetDataStore("LastName") local dobs = DataStoreService:GetDataStore("DOBs") local charSlot1 = DataStoreService:GetDataStore("Char1") fstr = FirstName:GetAsync(uid) local cg = Instance.new("BoolValue") cg.Parent = player cg.Name = "hasChar" cg.Value = charSlot1:GetAsync(uid) --this works local g = Instance.new("StringValue") g.Parent = player g.Name = "fname" g.Value = fstr --and this doesnt?
Output: http://prntscr.com/iif5cy
Any help would be greatly appreciated.