ProfileService Error

Hello.

I’m trying to use the ProfileService to save and access data. Everything has been working great so far, but I’ve hit a fork in the road with these autoclickers that I’m trying to script. I have data tables for their settings; however, the autoclickers don’t turn on when they’re supposed to. I did some debugging using print statements and found out that the ProfileService data is returning the wrong values compared to what I’ve set.

For example, one of the autoclickers has a default duration of 5 seconds; however, when I try to print the duration value, it returns 0.

Data Settings
local dataTemplate = {
	autoclickers = {
		standard = {
			enabled = false,
			duration = 5
		},
		fast = {
			enabled = false,
			duration = 5
		}
	}
}

return dataTemplate
Code
local function toggleAutoclicker(player, mode)

	local profile = dataManager.profiles[player]

	if not profile then
		return
	end

	print(mode)
	print(profile.Data.autoclickers.standard.duration)
	
end

events.ToggleAutoclicker.OnServerEvent:Connect(function(player, mode)
	toggleAutoclicker(player, mode)
end)
Result


image

Am I formatting something wrong? I’ve set the duration value to 5 in my script, but the profile says that it’s been set to 0. Help would be greatly appreciated.

Thank you.