- Joined
- Feb 11, 2011
- Messages
- 1,860
Hi guys,
I can't seem to figure out why this script doesn't work:
Thanks,
Mr_Bean
I can't seem to figure out why this script doesn't work:
JASS:
library CreepCounter
private function GroupConditions takes nothing returns boolean
return GetUnitTypeId(GetFilterUnit()) != DUMMY_ID and GetOwningPlayer(GetFilterUnit()) == Player(11)
endfunction
public function Create takes nothing returns nothing
local integer count = 0
set creepCounter = CreateLeaderboard()
call GroupEnumUnitsInRect(enumG, bj_mapInitialPlayableArea, Condition(function GroupConditions))
for enumU in enumG
set count = count + 1
endfor
call LeaderboardAddItem(creepCounter, "Creeps left:", count, Player(11))
call LeaderboardSetItemStyle(creepCounter, 1, true, true, false)
call LeaderboardSetItemLabelColor(creepCounter, 1, 100, 80, 0, 256)
call LeaderboardSetItemValueColor(creepCounter, 1, 100, 80, 0, 256)
call LeaderboardDisplay(creepCounter, false)
call LeaderboardDisplay(creepCounter, true)
endfunction
endlibrary
creepCounter
has been declared as a global elsewhere. When I run this with a debug message, it counts the number of creeps correctly, but does not display the leaderboard at all. Any ideas?Thanks,
Mr_Bean