How to attack a monster player:Attack(monsterId)?

How to attack a monster?

local player = Game.GetLocalPlayer()
player:Attack(monsterId) – does not work

local monster = Character.Get(monsterId)
monster:Attack(playerId) – is work