-- DONT USE RECENTPLAYERS DATASTORE
local DataStoreService = game:GetService("DataStoreService")
local PlayerJoinHistoryDataStore = DataStoreService:GetDataStore("PlayerJoinHistoryDataStore")

local scrollingFrame = game.StarterGui.SurfaceGui.Frame.ScrollingFrame
local displayTime = game.Workspace.TheList.DisplayVisitTime.Value

game.Players.PlayerAdded:connect(function(player)
	local list = game:GetService("DataStoreService"):GetDataStore("RecentPlayers2"):GetAsync("Players")

	if list and type(list) == "table" and #list > 0 then
		scrollingFrame:ClearAllChildren()
		scrollingFrame.CanvasSize = UDim2.new(0,0,0,(30*#list))

		for i,info in pairs(list) do
			local bullet = script.Parent.Template
			bullet.Text = info[1]
			if displayTime then
				local timeInfo = require(script.GetDate)(info[2])
				bullet.Text = bullet.Text.." @ "..timeInfo.hoursPm ..":"..timeInfo.minutes..":"..timeInfo.seconds.." "..(timeInfo.isAm and "AM" or "PM").." "..timeInfo.month.." "..timeInfo.day..", "..timeInfo.year
			end
			bullet.Position = UDim2.new(0,50, 0,(i-1)*30)
			bullet.Parent = scrollingFrame	
		end
	end
end)

The script is to log player visits on a text label, but after joining nothing displays. How would you make the text display properly?

1 comment

0

this might be a dumb question but are you sure you're saving anything to the datastore?