Member Board - Not Updating Text

Hey there, I’m trying to make a member board, but the text doesn’t seem to update, here’s my code:

local HttpService = game:GetService("HttpService")
local GroupService = game:GetService("GroupService")
local TweenService = game:GetService("TweenService")
local GroupID = 12212248  -- Put the group ID here
local MemberGoal = 350

local function getEmblemAsync(groupId)
	local success, groupInfo = pcall(function()
		return GroupService:GetGroupInfoAsync(groupId)
	end)
	return groupInfo.EmblemUrl
end

local function formatNumber(n)
	n = tostring(n)
	return n:reverse():gsub("%d%d%d", "%1,"):reverse():gsub("^,", "")
end

local groupIcon = getEmblemAsync(GroupID)
if groupIcon then
	script.Parent.GroupIcon.Image = groupIcon
end

task.spawn(function()
	while true do
		local response = HttpService:RequestAsync({
			Url = "https://groups.roproxy.com/v1/groups/" .. GroupID,
			Method = "GET"
		})
		if response.Success and response.Body then
			local data = HttpService:JSONDecode(response.Body)
			local memberCount = data.memberCount
			local membersNeeded = MemberGoal - memberCount
			local membersNeededString = tostring(membersNeeded)
			script.Parent.MemberCount.Counter:GetPropertyChangedSignal("Value"):Connect(function()
				script.Parent.MemberCount.Text = string.format("Members: %s", formatNumber(math.floor(script.Parent.MemberCount.Counter.Value)))
				script.Parent.Frame.current = "🎉 We're now at " .. string.format("Members: %s", formatNumber(math.floor(script.Parent.MemberCount.Counter.Value))) .. " members in our group! Only " .. membersNeededString .. " to go until " .. MemberGoal .. "!"
			end)

			local tween = TweenService:Create(script.Parent.MemberCount.Counter, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 0), { Value = memberCount })
			tween:Play()
		end
		task.wait(60)
	end
end)

This may also help…
image

Have you got any errors in console?

Yes, here are the errors.

Line 82 is script.Parent.MemberCount.Counter:GetPropertyChangedSignal("Value"):Connect(function() .

MemberCount is not a valid member of Workspace.memberCount.Screen.SurfaceGui.

image

From the image you provided above you can very clearly see how you’re missing a MemberCount UI object, which I’m going to presume is a text label.

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