How do I get Data from a each key in the datastore

I’ll need to see the button’s Logs.Mainscript to be able to spot the issue

Actually if this is the Logs.Mainscript I think I found the issue, here its written .. targetPlayer:

local function updateBanLogs(banData)
	for _, banInfo in ipairs(banData) do
		if not banInfo then continue end

		print("banInfo:", banInfo)
		print("banInfo.TargetPlayer:", banInfo.TargetPlayer)

		local newLog = Template:Clone()
		newLog.Parent = BanLogsScrollingFrame
		newLog.Name = banInfo.TargetPlayer
		newLog.TargetUsername.Text = "Target: " .. banInfo.TargetPlayer
		newLog.AdminUsername.Text = "Admin: " .. banInfo.AdminName
		newLog.BanReason.Text = "Reason: " .. banInfo.Reason

		newLog.Select.MouseButton1Click:Connect(function()
			targetPlayer = banInfo.TargetPlayer
			UnBanFrame.Visible = true
			UnBanFrame.Reason.Text = "Unban reason for " .. targetPlayer
		end)
	end
end

Instead of .. banInfo.TargetPlayer:

local function updateBanLogs(banData)
	for _, banInfo in ipairs(banData) do
		if not banInfo then continue end

		print("banInfo:", banInfo)
		print("banInfo.TargetPlayer:", banInfo.TargetPlayer)

		local newLog = Template:Clone()
		newLog.Parent = BanLogsScrollingFrame
		newLog.Name = banInfo.TargetPlayer
		newLog.TargetUsername.Text = "Target: " .. banInfo.TargetPlayer
		newLog.AdminUsername.Text = "Admin: " .. banInfo.AdminName
		newLog.BanReason.Text = "Reason: " .. banInfo.Reason

		newLog.Select.MouseButton1Click:Connect(function()
			targetPlayer = banInfo.TargetPlayer
			UnBanFrame.Visible = true
			UnBanFrame.Reason.Text = "Unban reason for " .. banInfo.TargetPlayer
		end)
	end
end
1 Like

Thank you for helping me, I found the solution but thanks to you I wouldn’t have been this close it fixing it but it works now!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.