View difference between Paste ID: mjncPWj8 and aGGycXNM
SHOW: | | - or go back to the newest paste.
1
-- outside function
2
local function countup(view, x, y, stats, name)
3-
	if stats[name] < 25 then stats[name] = stats[name] + 1 end
3+
	return function(event)
4-
	view.text = stats[name]
4+
		if stats[name] < 25 then stats[name] = stats[name] + 1 end
5-
	view:setReferencePoint(display.TopLeftReferencePoint)
5+
		view.text = stats[name]
6-
	view.x, view.y = x, y
6+
		view:setReferencePoint(display.TopLeftReferencePoint)
7
		view.x, view.y = x, y
8
	end
9
end
10
11-
		timer.performWithDelay(100, function(event) countup(self.attackText, 194, 153, self.Stats, "Attack") end, goalAttack - self.Stats.Attack) 
11+
12
	if goalAttack - self.Stats.Attack ~= 0 then 
13
		timer.performWithDelay(100, countup(self.attackText, 194, 153, self.Stats, "Attack"), goalAttack - self.Stats.Attack) 
14
	end