Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I get this GUI to refresh?

local ods = game:GetService("DataStoreService"):GetOrderedDataStore("HighScore")

function updateBoard(board, data)
	for k,v in pairs(data) do
		local pos = k
		local name = v.key
		local score = v.value
		local nametextbox = board.SurfaceGui:FindFirstChild("Name" .. pos)
		nametextbox.Text = name
		local scoretextbox = board.SurfaceGui:FindFirstChild("Score" .. pos)
		scoretextbox.Text = score
	end	
end

while true do
	local pages = ods:GetSortedAsync(false, 8)
	local data = pages:GetCurrentPage()
	updateBoard(game.Workspace.HighScore.TopBlock, data)
	wait(0.1)
	updateBoard(board, data)
end

It has a players score working and all, and if they get a new score the board dosent update. Everyone has to leave server and rejoin for bord to update. Is there a way to just get the board to update auto-matically?

1 answer

✓ Accepted answer

After wait(0.1) do updateBoard(board, data)

1 comment

0

it dosent work? I have editted with what I have.

This discussion is preserved as it was. New answers, comments, and votes are closed.