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

How to make a value that counts game visits?

I have a problem, i want to make a value that will count game visits, i have idea how this could work but i do not know how.

My idea:

local placeId = 12345678 local value = script.Parent

value.Value = placeId.VisitCount -- This does not work but should work like that I GUESS.

Please help. Thanks, kirda.

4 comments

1

You will need to know how to use https Service

0

no u just need datastore

0

nvm

0

Thanks, at least i know what to work with.

1 answer

local ds = game:GetService("DataStoreService")
visits = ds:GetDataStore("Visits")
game.Players.PlayerAdded:Connect(function(plr)
	local data
	local suc, err = pcall(function()
		data = visits:GetAsync("Visits")
	end)
	if suc then
		visits:SetAsync(data + 1)
	end
	data = data + 1
end)

I really don't recommend this but it's a weird way to save visits and might not count every visit so... idk listen to Nguyenlegiahung use https service

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