Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mod = RegisterMod("Show Healthbars", 1)
- local show_healthbars = false
- function mod:OnExecuteCmd(cmd, params)
- if cmd == "hps" then
- if show_healthbars then
- show_healthbars = false
- print("Disabled!")
- else
- print("Enabled!")
- end
- end
- end
- mod:AddCallback(ModCallbacks.MC_EXECUTE_CMD, mod.OnExecuteCmd)
- function mod:OnRender()
- if show_healthbars then
- for _,entity in pairs(Isaac.GetRoomEntities()) do
- if entity:IsVulnerableEnemy() then
- position = Isaac.WorldToRenderPosition(entity.Position) + Game():GetRoom():GetRenderScrollOffset()
- Isaac.RenderText(string.format("%.2f/%.2f", entity.HitPoints, entity.MaxHitPoints), position.X, position.Y, 1, 1, 1, 1)
- end
- end
- end
- end
- mod:AddCallback(ModCallbacks.MC_POST_RENDER, mod.OnRender)
Advertisement
Add Comment
Please, Sign In to add comment