Value don't change in leaderstats but prints correctly

Hello, I have been scirpting for around 1 year and 7 month now and this is my first post, just wanted to let you guys know. Either way. I may just be dumb since I have a little headache but look at this script I made:

game.ReplicatedStorage.Remotes.PlayGame.OnServerEvent:Connect(function(plr, amount, typ)
	local sparks = plr:WaitForChild("leaderstats"):WaitForChild("Sparks").Value
	if typ == "minus" then
		local subt = sparks - amount
		print(subt)
		sparks = subt
	else
		if typ == "add" then
			local add = sparks + amount
			print(add)
			sparks = add
		end
	end
end)

For some reason, it does not update the sparks in the game. when I do the (print(add)) it prints exactly what I want but when I do (sparks = add) it doesn’t change anything and I have no clue why.

As I said, I might just be dumb because of my headache but I would really want some help.

Thank you! :+1:

You then need to update the value of the sparks value so it updates.

I don’t know how I couldn’t think of that. I am pretty slow today lmao. Either way. Thank you :+1: