Hello, im porting a hack, and it contains that when you kill 5 big goombas a star appears, I tried this code but doesnt work, the star appears instantly without killing the goombas
Code:
Code:
---@param obj Object
function bhv_custom_goomba_star_spawn_loop(obj)
if obj.oAction == 1 then
return
end
if count_objects_with_behavior(get_id_from_behavior(id_bhvGoomba)) ~= 0 then
return
end
obj.oAction = 1
local star = spawn_red_coin_cutscene_star(obj.oPosX, obj.oPosY, obj.oPosZ)
star.oBehParams = obj.oBehParams
end
id_bhvGoombaStar = hook_behavior(nil,OBJ_LIST_LEVEL,false,nil,bhv_custom_goomba_star_spawn_loop)